home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / winterp-1.13 / src-server / w_resources.c < prev    next >
Encoding:
C/C++ Source or Header  |  1991-10-05  |  190.8 KB  |  4,225 lines

  1. /* -*-C-*-
  2. ********************************************************************************
  3. *
  4. * File:         w_resources.c
  5. * RCS:          $Header: w_resources.c,v 1.15 91/03/24 18:22:43 mayer Exp $
  6. * Description:  WINTERP interfaces to Motif and Xtoolkit resources
  7. * Author:       Niels Mayer, HPLabs
  8. * Created:      Sat Jul 22 04:42:12 1989
  9. * Modified:     Fri Oct  4 20:16:24 1991 (Niels Mayer) mayer@hplnpm
  10. * Language:     C
  11. * Package:      N/A
  12. * Status:       X11r5 contrib tape release
  13. *
  14. * WINTERP Copyright 1989, 1990, 1991 Hewlett-Packard Company (by Niels Mayer).
  15. * XLISP version 2.1, Copyright (c) 1989, by David Betz.
  16. *
  17. * Permission to use, copy, modify, distribute, and sell this software and its
  18. * documentation for any purpose is hereby granted without fee, provided that
  19. * the above copyright notice appear in all copies and that both that
  20. * copyright notice and this permission notice appear in supporting
  21. * documentation, and that the name of Hewlett-Packard and David Betz not be
  22. * used in advertising or publicity pertaining to distribution of the software
  23. * without specific, written prior permission.  Hewlett-Packard and David Betz
  24. * make no representations about the suitability of this software for any
  25. * purpose. It is provided "as is" without express or implied warranty.
  26. *
  27. * HEWLETT-PACKARD AND DAVID BETZ DISCLAIM ALL WARRANTIES WITH REGARD TO THIS
  28. * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
  29. * IN NO EVENT SHALL HEWLETT-PACKARD NOR DAVID BETZ BE LIABLE FOR ANY SPECIAL,
  30. * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  31. * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  32. * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  33. * PERFORMANCE OF THIS SOFTWARE.
  34. *
  35. * See ./winterp/COPYRIGHT for information on contacting the authors.
  36. * Please send modifications, improvements and bugfixes to mayer@hplabs.hp.com
  37. * Post XLISP-specific questions/information to the newsgroup comp.lang.lisp.x
  38. *
  39. ********************************************************************************
  40. */
  41. static char rcs_identity[] = "@(#)$Header: w_resources.c,v 1.15 91/03/24 18:22:43 mayer Exp $";
  42.  
  43. /*
  44.  * <limits.h> defines machine dependent limits on sizes of numbers, if your
  45.  * machine doesn't have this, then your compiler doesn't conform to standards
  46.  * XPG2, XPG3, POSIX.1, FIPS 151-1 and you should complain to the manufacturer.
  47.  * 
  48.  * If for some reason your system isn't standards-conforming, you may work
  49.  * around this problem by using the following definitions (assuming 32 bit machine):
  50.  * 
  51.  * #define USHRT_MAX 65535
  52.  * #define SHRT_MIN (-32768)
  53.  * #define SHRT_MAX 32767
  54.  * #define INT_MAX 2147483647
  55.  * #define INT_MIN (-2147483647 - 1)
  56.  * #define LONG_MIN (-2147483647 - 1)
  57.  */
  58. #include <limits.h>
  59.  
  60. #include <stdio.h>
  61. #include <Xm/XmP.h>        /* need XmP.h, rather than Xm.h because we need to access object.parent and some core fields directly */
  62. #include <X11/ShellP.h>        /* need ShellP.h rather than Shell.h because we access ((ShellWidget) widgetID)->core */
  63.  
  64. #include "winterp.h"        /* this must occur before doing "#ifdef WINTERP_MOTIF_11" */
  65.  
  66. #ifdef WINTERP_MOTIF_11
  67. #include <Xm/MwmUtil.h>
  68. #else                /* Motif 1.0 */
  69. #include <X11/MwmUtil.h>
  70. #include <Xm/Text.h>        /* needed to define XmTextScanType for "XmRSelectionArray" -- in Motif 1.1, this has moved to <Xm/Xm.h> */
  71. #endif                /* WINTERP_MOTIF_11 */
  72.  
  73. #include "user_prefs.h"
  74. #include "xlisp/xlisp.h"
  75. #include "w_XmString.h"
  76.  
  77. #ifdef HP_GRAPH_WIDGET
  78. #include <Xm/Graph.h>
  79. #include <Xm/Arc.h>
  80. #endif                /* HP_GRAPH_WIDGET */
  81.  
  82. extern char temptext[];    /* from winterp.c */
  83. static void Wres_Free_This_Later();
  84.  
  85. /* these are used by :get_child methods on various widget classes. */
  86. LVAL s_XmDIALOG_WORK_AREA,    /* FileSB SelectioB */
  87.   s_XmDIALOG_APPLY_BUTTON,    /* SelectioB MessageB FileSB */
  88.   s_XmDIALOG_CANCEL_BUTTON,    /* FileSB MessageB SelectioB */
  89.   s_XmDIALOG_DEFAULT_BUTTON,    /* FileSB MessageB SelectioB */
  90.   s_XmDIALOG_OK_BUTTON,        /*FileSB MessageB SelectioB  */
  91. #ifdef WINTERP_MOTIF_11
  92.   s_XmDIALOG_DIR_LIST,        /* FileSB */
  93.   s_XmDIALOG_DIR_LIST_LABEL,    /* FileSB */
  94. #endif /* WINTERP_MOTIF_11 */
  95.   s_XmDIALOG_FILTER_LABEL,    /* FileSB */
  96.   s_XmDIALOG_FILTER_TEXT,    /* FileSB */
  97.   s_XmDIALOG_HELP_BUTTON,    /* FileSB MessageB SelectioB */
  98.   s_XmDIALOG_LIST,        /* FileSB SelectioB  */
  99.   s_XmDIALOG_HISTORY_LIST,    /* Command */
  100.   s_XmDIALOG_LIST_LABEL,    /* FileSB SelectioB */
  101.   s_XmDIALOG_MESSAGE_LABEL,    /* MessageB */
  102.   s_XmDIALOG_SELECTION_LABEL,    /* FileSB SelectioB */
  103.   s_XmDIALOG_PROMPT_LABEL,    /* Command */
  104.   s_XmDIALOG_SYMBOL_LABEL,    /* MessageB */
  105.   s_XmDIALOG_TEXT,        /* FileSB SelectioB */
  106.   s_XmDIALOG_COMMAND_TEXT,    /* Command */
  107.   s_XmDIALOG_SEPARATOR;        /* FileSB MessageB SelectioB */
  108.  
  109.  
  110.  
  111. typedef union {
  112.   XtPointer XtPointer_value;    /* XtPointer == Opaque == caddr_t == XtAccelerators, etc */
  113.   XtEnum    XtEnum_value;
  114.   Boolean   Boolean_value;
  115.   Bool      Bool_value;
  116.   int       int_value;
  117. #ifdef WINTERP_MOTIF_11
  118.   KeySym    KeySym_value;
  119.   XmTextPosition XmTextPosition_value; /* XmTextPosition == long */
  120. #else
  121.   char      char_value;
  122. #endif                /* WINTERP_MOTIF_11 */
  123.   Dimension Dimension_value;
  124.   Position  Position_value;
  125.   short     short_value;
  126.   String    String_value;
  127. } GetValues_Union;
  128.  
  129. typedef struct _Resource_Enums {
  130.   char*  printname;        /* name of enumerated resource value (a lisp keyword -- must be uppercase and begin w/ ':') */
  131.   XtEnum c_value;        /* the Xtoolkit/Motif value */
  132.   LVAL   lisp_value;        /* the Lisp symbol id associated w/ printname (set in Wres_Init() by proc Init_Enumerated_Type_Syms() */
  133. } Resource_Enums;
  134.  
  135. typedef struct _Resource_Class {
  136.   char*           XmR_type;    /* the XmR* resource representation -- the "type" of the Xt resource needed by XtConvert() */
  137.   char            LVAL_type;    /* enumerated type -- the type of the LVAL datum to be set via XtSetValues */
  138.   LVAL            (*resource_val_to_LVAL_converter)( /* GetValues_Union */ ); /* ptr to function that converts resource from C to Lisp (for XtGetValues) */
  139.   XtArgVal        (*LVAL_to_resource_val_converter)( /*LVAL*/ ); /* ptr to function that converts resource from Lisp to C (for XtSetValues) */
  140.   Resource_Enums* enums_alist;    /* for enumerated resources, this points to a NULL terminated array of MotifValue/LispValue pairs */
  141. } Resource_Class;
  142.  
  143. typedef struct _Resource_Instance {
  144.   char*           printname;    /* lisp printname for the resource */
  145.   Resource_Class* class;    /* pointer to Resource_Class structure -- the value of 'symbol' in lisp */
  146.   char*           name;        /* holds the XmN* name */
  147.   LVAL            symbol;    /* holds the lisp symbol assoc'd w/ this resource -- set in Wres_Init() */
  148. } Resource_Instance;
  149.  
  150.  
  151. /*****************************************************************************
  152.  * This procedure is the generic  C/Motif/Xt-enumerated-type to
  153.  * Lisp-enumeration-symbol converter. The conversion is based on the
  154.  * Resource_Enums* array that is set for each enumerated type resource class.
  155.  ****************************************************************************/
  156. static LVAL Cvt_XtEnum_to_LVAL(res_val, resource)
  157.      GetValues_Union    res_val;
  158.      Resource_Instance* resource;
  159. {
  160.   register XtEnum value = res_val.XtEnum_value;
  161.   register Resource_Enums* alist = &(resource->class->enums_alist[0]);
  162.  
  163.   while (alist->printname && (value != alist->c_value))
  164.     alist++;
  165.   if (alist->printname)        /* if not at end of alist, then (alist->c_value == value) */
  166.     return (alist->lisp_value);    /* return the symbol LVAL assoc'd w/ value */
  167.   else {            /* else give error message */
  168.     sprintf(temptext,
  169.         "Cvt_XtEnum_to_LVAL() internal error: Could not convert value %lu retrieved by XtGetValues() to enumerated type XmR%s.",
  170.         (unsigned long) value,
  171.         resource->class->XmR_type);
  172.     xlerror(temptext, resource->symbol); 
  173.   }
  174. }
  175.  
  176. /*****************************************************************************
  177.  * Essentially same as above, except that the resource value expected is
  178.  * declared as 'int' rather than 'unsigned char'. This procedure should
  179.  * go away as soon as Xt/Motif resource declarations are made consistent.
  180.  ****************************************************************************/
  181. static LVAL Cvt_Enum_Int_to_LVAL(res_val, resource)
  182.      GetValues_Union    res_val;
  183.      Resource_Instance* resource;
  184. {
  185.   register int value = res_val.int_value;
  186.   register Resource_Enums* alist = &(resource->class->enums_alist[0]);
  187.  
  188.   while (alist->printname && (value != alist->c_value))
  189.     alist++;
  190.   if (alist->printname)        /* if not at end of alist, then (alist->c_value == value) */
  191.     return (alist->lisp_value);    /* return the symbol LVAL assoc'd w/ value */
  192.   else {            /* else give error message */
  193.     sprintf(temptext,
  194.         "Cvt_XtEnum_to_LVAL() internal error: Could not convert value %lu retrieved by XtGetValues() to enumerated type XmR%s.",
  195.         (unsigned long) value,
  196.         resource->class->XmR_type);
  197.     xlerror(temptext, resource->symbol); 
  198.   }
  199. }
  200.  
  201. /*****************************************************************************
  202.  * This procedure is the generic Lisp-enumeration-symbol to
  203.  * C/Motif/Xt-enumerated-type converter. The conversion is based on the
  204.  * Resource_Enums* array that is set for each enumerated type resource class.
  205.  ****************************************************************************/
  206. static XtArgVal Cvt_LVAL_to_XtEnum(lisp_val, resource, o_widget)
  207.      LVAL               lisp_val;
  208.      Resource_Instance* resource;
  209.      LVAL               o_widget;
  210. {
  211.   register Resource_Enums* alist = &(resource->class->enums_alist[0]);
  212.  
  213.   while (alist->printname && (lisp_val != alist->lisp_value))
  214.     alist++;
  215.   if (alist->printname)        /* if not at end of alist, then (alist->lisp_value == lisp_val) */
  216.     return ((XtArgVal) alist->c_value);    /* return the C value assoc'd w/ lisp_val */
  217.   else {            /* else give error message */
  218.     char* cptr;
  219.     sprintf(temptext,
  220.         "Note: Resources of type XmR%s may only be set to the following enumerated values:\n",
  221.         resource->class->XmR_type);
  222.     errputstr(temptext);
  223.  
  224.     alist = &(resource->class->enums_alist[0]);
  225.     cptr = &(temptext[0]);
  226.     *cptr++ = '\t';
  227.     *cptr++ = '[';
  228.     while (alist->printname) {
  229.       int len = strlen(alist->printname);
  230.       strncpy(cptr, alist->printname, len);
  231.       cptr += len;
  232.       *cptr++ = ' ';
  233.       alist++;
  234.     }
  235.     *cptr++ = ']';
  236.     *cptr++ = '\n';
  237.     *cptr++ = '\000';
  238.     errputstr(temptext); 
  239.  
  240.     sprintf(temptext,
  241.         "Attempted to set resource %s of type XmR%s to invalid value (see note above).",
  242.         resource->printname,
  243.         resource->class->XmR_type);
  244.     xlerror(temptext, lisp_val);
  245.   }
  246. }
  247.  
  248.  
  249. /*****************************************************************************
  250.  * This procedure must be called in Wres_Init() for each Resource_Enums* array
  251.  * set up in defining an enumerated resource.
  252.  ****************************************************************************/
  253. static void Init_Enumerated_Type_Syms(enums_alist)
  254.      Resource_Enums* enums_alist;
  255. {
  256.   register Resource_Enums* alist = &(enums_alist[0]);
  257.   while (alist->printname) {
  258.     alist->lisp_value = xlenter(alist->printname);
  259.     alist++;
  260.   }
  261. }
  262.  
  263. /*****************************************************************************
  264.  * Wres_Check_Value_Against_Minimum() and Wres_Check_Value_Against_Maximum()
  265.  * are called in converting from lisp to XmRDimension, XmRInt, 
  266.  * XmRPosition, XmRShort in procedures Cvt_LVAL_to_XmR...()
  267.  ****************************************************************************/
  268. static void Wres_Check_Value_Against_Minimum(value, minimum, resource, lisp_val)
  269.      long value;
  270.      long minimum;
  271.      Resource_Instance* resource;
  272.      LVAL lisp_val;
  273. {
  274.   if (value < minimum) {
  275.     sprintf(temptext,
  276.         "Value of resource %s (type XmR%s) must be a FIXNUM >= %ld.",
  277.         resource->printname,
  278.         resource->class->XmR_type,
  279.         minimum);
  280.     xlerror(temptext, lisp_val);
  281.   }
  282. }
  283.  
  284. static void Wres_Check_Value_Against_Maximum(value, maximum, resource, lisp_val)
  285.      long value;
  286.      long maximum;
  287.      Resource_Instance* resource;
  288.      LVAL lisp_val;
  289. {
  290.   if (value > maximum) {
  291.     sprintf(temptext,
  292.         "Value of resource %s (type XmR%s) must be a FIXNUM <= %ld.",
  293.         resource->printname,
  294.         resource->class->XmR_type,
  295.         maximum);
  296.     xlerror(temptext, lisp_val);
  297.   }
  298. }
  299.  
  300.  
  301. /**************************************************************************/
  302. /****************** R E S O U R C E    C O N V E R T E R S ****************/
  303. /**************************************************************************/
  304.  
  305.  
  306. /******************************************************************************/
  307. static LVAL Cvt_XmRAcceleratorTable_to_LVAL(res_val, resource)
  308.      GetValues_Union    res_val;
  309.      Resource_Instance* resource;
  310. {
  311.   return (res_val.XtPointer_value ? cv_xtaccelerators((XtAccelerators) res_val.XtPointer_value) : NIL);
  312. }
  313.  
  314. static XtArgVal Cvt_LVAL_to_XmRAcceleratorTable(lisp_val, resource, o_widget)
  315.      LVAL               lisp_val;
  316.      Resource_Instance* resource;
  317.      LVAL               o_widget;
  318. {
  319.   return ((XtArgVal) get_xtaccelerators(lisp_val));
  320. }
  321.  
  322. static Resource_Class resclass_XmRAcceleratorTable = {
  323.   XmRAcceleratorTable,        
  324.   XLTYPE_XtAccelerators,
  325.   Cvt_XmRAcceleratorTable_to_LVAL, 
  326.   Cvt_LVAL_to_XmRAcceleratorTable}; /* sizeof (XtAccelerators) */
  327.  
  328.  
  329.  
  330. /******************************************************************************/
  331. static Resource_Enums XmRAlignment_enums_alist[] = {
  332.   {":ALIGNMENT_BEGINNING",    XmALIGNMENT_BEGINNING,        NULL},
  333.   {":ALIGNMENT_CENTER",        XmALIGNMENT_CENTER,        NULL},
  334.   {":ALIGNMENT_END",        XmALIGNMENT_END,        NULL},
  335.   {NULL, NULL, NULL}
  336. };
  337.  
  338. static Resource_Class resclass_XmRAlignment = {
  339.   XmRAlignment,    
  340.   SYMBOL,            /* XmRAlignment is an enumerated type */
  341.   Cvt_XtEnum_to_LVAL, 
  342.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  343.   XmRAlignment_enums_alist
  344.   };
  345.  
  346.  
  347.  
  348. /********************************************************************************/
  349. static Resource_Enums XmRArrowDirection_enums_alist[] = {
  350.   {":ARROW_UP",        XmARROW_UP,    NULL},
  351.   {":ARROW_DOWN",    XmARROW_DOWN,    NULL},
  352.   {":ARROW_LEFT",    XmARROW_LEFT,    NULL},
  353.   {":ARROW_RIGHT",    XmARROW_RIGHT,    NULL},
  354.   {NULL, NULL, NULL}
  355. };
  356.  
  357. static Resource_Class resclass_XmRArrowDirection = {
  358.   XmRArrowDirection,    
  359.   SYMBOL,            /* enumerated type */
  360.   Cvt_XtEnum_to_LVAL, 
  361.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  362.   XmRArrowDirection_enums_alist
  363.   };
  364.  
  365.  
  366.  
  367. /********************************************************************************/
  368. static Resource_Enums XmRAttachment_enums_alist[] = {
  369.   {":ATTACH_NONE",        XmATTACH_NONE,        NULL},
  370.   {":ATTACH_FORM",        XmATTACH_FORM,        NULL},
  371.   {":ATTACH_OPPOSITE_FORM",    XmATTACH_OPPOSITE_FORM,    NULL},
  372.   {":ATTACH_WIDGET",        XmATTACH_WIDGET,    NULL},
  373.   {":ATTACH_OPPOSITE_WIDGET",    XmATTACH_OPPOSITE_WIDGET, NULL},
  374.   {":ATTACH_POSITION",        XmATTACH_POSITION,    NULL},
  375.   {":ATTACH_SELF",        XmATTACH_SELF,        NULL},
  376.   {NULL, NULL, NULL}
  377. };
  378.  
  379. static Resource_Class resclass_XmRAttachment = {
  380.   XmRAttachment,    
  381.   SYMBOL,            /* enumerated type */
  382.   Cvt_XtEnum_to_LVAL, 
  383.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  384.   XmRAttachment_enums_alist
  385.   };
  386.  
  387.  
  388.  
  389. /******************************************************************************/
  390. /*
  391.  * Resource representation type XmRBool is essentially the same as boolean.
  392.  * It is only used for the resource XmNinput.
  393.  * Resource instances of type XmRBool unfortunately cannot be thrown into
  394.  * resource class XmRBoolean because type Boolean=='unsigned char' while
  395.  * type Bool=='int'. If XmRBool was treated as XmRBoolean, then doing :GET_VALUES
  396.  * on such a resource would retrieve invalid values.
  397.  *
  398.  * This entire resource class should be thrown away if and when Motif and Xt get
  399.  * some more consistently named/typed resources.
  400.  */
  401. static LVAL Cvt_XmRBool_to_LVAL(res_val, resource)
  402.      GetValues_Union    res_val;
  403.      Resource_Instance* resource;
  404. {
  405.   extern LVAL true;
  406.   if (res_val.Bool_value)
  407.     return (true);
  408.   else
  409.     return (NIL);
  410. }
  411.  
  412. static XtArgVal Cvt_LVAL_to_XmRBool(lisp_val, resource, o_widget)
  413.      LVAL               lisp_val;
  414.      Resource_Instance* resource;
  415.      LVAL               o_widget;
  416. {
  417.   if (lisp_val == NIL)
  418.     return ((XtArgVal) ((Bool) FALSE));
  419.   else
  420.     return ((XtArgVal) ((Bool) TRUE));
  421. }
  422.  
  423. static Resource_Class resclass_XmRBool = {
  424.   XmRBool,
  425.   FREE,            /* any kind of LVAL is ok here, if == NIL, then false, else true. */
  426.   Cvt_XmRBool_to_LVAL, 
  427.   Cvt_LVAL_to_XmRBool}; /* sizeof(Bool) == sizeof(int) */
  428.  
  429.  
  430. /******************************************************************************/
  431. #ifdef WINTERP_MOTIF_11
  432. /*
  433.  * Resource representation type XmRBooleanDimension is essentially the same as
  434.  * boolean. In Motif 1.1, it is only used for the resource XmNshowAsDefault.
  435.  *
  436.  * Resource instances of type XmRBooleanDimension unfortunately cannot be thrown
  437.  * into resource class XmRBoolean because type Boolean=='unsigned char' while
  438.  * XmRBooleanDimension is sizeof(Dimension)=='unsigned short'. If
  439.  * XmRBooleanDimension was treated as XmRBoolean, then doing :GET_VALUES
  440.  * on such a resource would retrieve invalid values.
  441.  *
  442.  * This entire resource class should be thrown away if and when Motif and Xt get
  443.  * some more consistently named/typed resources.
  444.  */
  445. static LVAL Cvt_XmRBooleanDimension_to_LVAL(res_val, resource)
  446.      GetValues_Union    res_val;
  447.      Resource_Instance* resource;
  448. {
  449.   extern LVAL true;
  450.   if (res_val.Dimension_value)
  451.     return (true);
  452.   else
  453.     return (NIL);
  454. }
  455.  
  456. static XtArgVal Cvt_LVAL_to_XmRBooleanDimension(lisp_val, resource, o_widget)
  457.      LVAL               lisp_val;
  458.      Resource_Instance* resource;
  459.      LVAL               o_widget;
  460. {
  461.   if (lisp_val == NIL)
  462.     return ((XtArgVal) ((Dimension) FALSE));
  463.   else
  464.     return ((XtArgVal) ((Dimension) TRUE));
  465. }
  466.  
  467. static Resource_Class resclass_XmRBooleanDimension = {
  468.   XmRBooleanDimension,
  469.   FREE,            /* any kind of LVAL is ok here, if == NIL, then false, else true. */
  470.   Cvt_XmRBooleanDimension_to_LVAL, 
  471.   Cvt_LVAL_to_XmRBooleanDimension}; /* sizeof(Dimension) == sizeof(unsigned short) */
  472. #endif                /* WINTERP_MOTIF_11 */
  473.  
  474.  
  475.  
  476. /******************************************************************************/
  477. static LVAL Cvt_XmRBoolean_to_LVAL(res_val, resource)
  478.      GetValues_Union    res_val;
  479.      Resource_Instance* resource;
  480. {
  481.   extern LVAL true;
  482.   if (res_val.Boolean_value)
  483.     return (true);
  484.   else
  485.     return (NIL);
  486. }
  487.  
  488. static XtArgVal Cvt_LVAL_to_XmRBoolean(lisp_val, resource, o_widget)
  489.      LVAL               lisp_val;
  490.      Resource_Instance* resource;
  491.      LVAL               o_widget;
  492. {
  493.   if (lisp_val == NIL)
  494.     return ((XtArgVal) ((Boolean) FALSE));
  495.   else
  496.     return ((XtArgVal) ((Boolean) TRUE));
  497. }
  498.  
  499. static Resource_Class resclass_XmRBoolean = {
  500.   XmRBoolean,
  501.   FREE,            /* any kind of LVAL is ok here, if == NIL, then false, else true. */
  502.   Cvt_XmRBoolean_to_LVAL, 
  503.   Cvt_LVAL_to_XmRBoolean}; /* sizeof(Boolean) == sizeof(char) */
  504.  
  505.  
  506.  
  507. /********************************************************************************/
  508. #ifdef WINTERP_MOTIF_11
  509. static LVAL Cvt_XmRButtonTypeTable_to_LVAL(res_val, resource)
  510.      GetValues_Union    res_val;
  511.      Resource_Instance* resource;
  512. {
  513.   /*
  514.    * XmRButtonType resource XmNbuttonType is a create-time only resource.
  515.    * it cannot be retrieved via :GET_VALUES.
  516.    */
  517.   sprintf(temptext,
  518.       "Motif disallows :GET_VALUES on resource of type XmR%s.",
  519.       resource->class->XmR_type);
  520.   xlerror(temptext, resource->symbol);
  521. }
  522.  
  523. static Resource_Enums XmRButtonType_enums_alist[] = {
  524.   {":PUSHBUTTON",    XmPUSHBUTTON,        NULL},
  525.   {":TOGGLEBUTTON",    XmTOGGLEBUTTON,        NULL},
  526.   {":CHECKBUTTON",    XmCHECKBUTTON,        NULL},
  527.   {":RADIOBUTTON",    XmRADIOBUTTON,        NULL},
  528.   {":CASCADEBUTTON",    XmCASCADEBUTTON,    NULL},
  529.   {":SEPARATOR",    XmSEPARATOR,        NULL},
  530.   {":DOUBLE_SEPARATOR",    XmDOUBLE_SEPARATOR,    NULL},
  531.   {":TITLE",        XmTITLE,        NULL},
  532.   {NULL, NULL, NULL}
  533. };
  534.  
  535. /*
  536.  * This procedure was mutated from Cvt_LVAL_to_XtEnum(). Couldn't
  537.  * use Cvt_LVAL_to_XtEnum() directly because we need to call XtFree()
  538.  * on the <typetable> parameter before signaling an error.
  539.  *
  540.  * Note: this is very similar to Cvt_LVAL_to_XmTextScanType()
  541.  * if changing/fixing this, fix the other. These should be merged, but I'm lazy.
  542.  */
  543. static XmButtonType Cvt_LVAL_to_XmRButtonType(lisp_val, resource, typetable)
  544.      LVAL               lisp_val;
  545.      Resource_Instance* resource;
  546.      XmButtonTypeTable typetable;
  547. {
  548.   register Resource_Enums* alist = &(XmRButtonType_enums_alist[0]);
  549.  
  550.   while (alist->printname && (lisp_val != alist->lisp_value))
  551.     alist++;
  552.   if (alist->printname)        /* if not at end of alist, then (alist->lisp_value == lisp_val) */
  553.     return ((XmButtonType) alist->c_value); /* return the C value assoc'd w/ lisp_val */
  554.   else {            /* else give error message */
  555.     char* cptr;
  556.  
  557.     XtFree(typetable);        /* must free the XmButtonTypeTable created below in Cvt_LVAL_to_XmRButtonType() */
  558.  
  559.     sprintf(temptext,
  560.         "Note: Resources of type XmR%s may only be set to the following enumerated values:\n",
  561.         resource->class->XmR_type);
  562.     errputstr(temptext);
  563.  
  564.     alist = &(XmRButtonType_enums_alist[0]);
  565.     cptr = &(temptext[0]);
  566.     *cptr++ = '\t';
  567.     *cptr++ = '[';
  568.     while (alist->printname) {
  569.       int len = strlen(alist->printname);
  570.       strncpy(cptr, alist->printname, len);
  571.       cptr += len;
  572.       *cptr++ = ' ';
  573.       alist++;
  574.     }
  575.     *cptr++ = ']';
  576.     *cptr++ = '\n';
  577.     *cptr++ = '\000';
  578.     errputstr(temptext); 
  579.  
  580.     sprintf(temptext,
  581.         "Attempted to set resource %s of type XmR%s to invalid value (see note above).",
  582.         resource->printname,
  583.         resource->class->XmR_type);
  584.     xlerror(temptext, lisp_val);
  585.   }
  586. }
  587.  
  588. #define XMBUTTONTYPETABLE_SIZE_INCREMENT 20
  589. static XtArgVal Cvt_LVAL_to_XmRButtonTypeTable(lisp_val, resource, o_widget)
  590.      LVAL               lisp_val;
  591.      Resource_Instance* resource;
  592.      LVAL               o_widget;
  593. {
  594.   int size, i;
  595.   XmButtonTypeTable typetable;
  596.  
  597.   /*
  598.    * if argument is a vector, then step through array, converting each
  599.    * lisp button-type symbol to a motif unsigned char enumeration.
  600.    */
  601.   if (vectorp(lisp_val)) {
  602.     size = getsize(lisp_val);
  603.     typetable = (XmButtonTypeTable) XtMalloc((unsigned) (size * sizeof(XmButtonType)));
  604.  
  605.     for (i = 0; i < size; i++)
  606.       typetable[i] = Cvt_LVAL_to_XmRButtonType(getelement(lisp_val, i), resource, typetable); /* will free typetable if this proc. signalls an error */
  607.  
  608.     Wres_Free_This_Later((XtPointer) typetable, XtFree); /* free typetable after the resource is set. */
  609.     return ((XtArgVal) typetable);
  610.   }
  611.   /*
  612.    * if argument is a list, then cdr through list converting each
  613.    * lisp button-type symbol to a motif unsigned char enumeration.
  614.    */
  615.   else if (consp(lisp_val)) {
  616.     size = XMBUTTONTYPETABLE_SIZE_INCREMENT;
  617.     typetable = (XmButtonTypeTable) XtMalloc((unsigned) (size * sizeof(XmButtonType)));
  618.  
  619.     for (i = 0 ; (consp(lisp_val)) ; lisp_val = cdr(lisp_val), i++) {
  620.       if (i >= size) {        /* make sure it'll fit into allocated typetable */
  621.     size += XMBUTTONTYPETABLE_SIZE_INCREMENT;
  622.     typetable = (XmButtonTypeTable) XtRealloc(typetable, (unsigned) (size * sizeof(XmButtonType)));    /* will free typetable if this proc. signalls an error */
  623.       }
  624.       typetable[i] = Cvt_LVAL_to_XmRButtonType(car(lisp_val), resource, typetable);
  625.     }
  626.     if (lisp_val) {        /* if loop terminated due to list pointer not being a CONS cell */
  627.       XtFree(typetable);
  628.       sprintf(temptext,
  629.           "Resource %s (type XmR%s) expected a list of ButtonType keywords --found invalid XmButtonTypeTable list element.",
  630.           resource->printname,
  631.           resource->class->XmR_type);
  632.       xlerror(temptext, lisp_val);
  633.     }
  634.     Wres_Free_This_Later((XtPointer) typetable, XtFree); /* free typetable after the resource is set. */
  635.     return ((XtArgVal) typetable);
  636.   }
  637.   /*
  638.    * if argument wasn't list or vector, then error
  639.    */
  640.   else {
  641.     sprintf(temptext,
  642.         "Resource %s (type XmR%s) expected a list or vector of ButtonType keywords.",
  643.         resource->printname,
  644.         resource->class->XmR_type);
  645.     xlerror(temptext, lisp_val);
  646.   }
  647. }
  648.  
  649. static Resource_Class resclass_XmRButtonTypeTable = {
  650.   XmRButtonType,    
  651.   FREE,                /* can either be a vector or a list */
  652.   Cvt_XmRButtonTypeTable_to_LVAL, 
  653.   Cvt_LVAL_to_XmRButtonTypeTable}; /* sizeof(XmButtonTypeTable) == sizeof(XmButtonType *) == sizeof(unsigned char *) */
  654. #endif /* WINTERP_MOTIF_11 */
  655.  
  656.  
  657.  
  658. /******************************************************************************/
  659. static LVAL Cvt_XmRCallback_to_LVAL(res_val, resource)
  660.      GetValues_Union    res_val;
  661.      Resource_Instance* resource;
  662. {
  663.   sprintf(temptext,
  664.       "Method :GET_VALUES not supported on resources of type XmR%s.",
  665.       resource->class->XmR_type);
  666.   xlerror(temptext, resource->symbol); 
  667. }
  668.  
  669. static XtArgVal Cvt_LVAL_to_XmRCallback(lisp_val, resource, o_widget)
  670.      LVAL               lisp_val;
  671.      Resource_Instance* resource;
  672.      LVAL               o_widget;
  673. {
  674.   sprintf(temptext,
  675.       "Setting resources of type XmR%s not supported. Use methods :SET_CALLBACK or :ADD_CALLBACK instead.",
  676.       resource->class->XmR_type);
  677.   xlerror(temptext, resource->symbol); 
  678. }
  679.  
  680. static Resource_Class resclass_XmRCallback = {
  681.   XmRCallback,
  682.   FREE,                /* should be XLTYPE_XtCallbackList; use FREE here so that above error messages are used, rather than "In Widget Arglist: expected resource value of type Callback. - (FOO)" */
  683.   Cvt_XmRCallback_to_LVAL,
  684.   Cvt_LVAL_to_XmRCallback};    /* sizeof(XtCallbackList) which
  685.                    is a pointer to a struct holding a *fn()
  686.                    and the closure data. */
  687.  
  688.  
  689.  
  690. /********************************************************************************/
  691. /*
  692.  * Motif 1.1 BUGFIX: 1.1 defines resources XmNmnemonic and XmNoptionMnemonic
  693.  * as XmRKeySym. Functionally, however, a character value is used here.
  694.  * Note however that the character value must be  sizeof(KeySym), thus for
  695.  * retrieval, we use a new element in union GetValues_Union -- KeySym_value.
  696.  */
  697. #ifdef WINTERP_MOTIF_11
  698.  
  699. static LVAL Cvt_XmRKeySym_to_LVAL(res_val, resource)
  700.      GetValues_Union    res_val;
  701.      Resource_Instance* resource;
  702. {
  703.   return (cvchar((int) res_val.KeySym_value));
  704. }
  705.  
  706. static XtArgVal Cvt_LVAL_to_XmRKeySym(lisp_val, resource, o_widget)
  707.      LVAL               lisp_val;
  708.      Resource_Instance* resource;
  709.      LVAL               o_widget;
  710. {
  711.   return ((XtArgVal) ((KeySym) getchcode(lisp_val)));
  712. }
  713.  
  714. static Resource_Class resclass_XmRKeySym = {
  715.   XmRKeySym,
  716.   CHAR,    
  717.   Cvt_XmRKeySym_to_LVAL,        /* use cvchar of ascii value of character */
  718.   Cvt_LVAL_to_XmRKeySym};        /* sizeof(KeySym) == sizeof(XID) == sizeof(long) */
  719.  
  720. #else                /* MOTIF 1.0 */
  721.  
  722. static LVAL Cvt_XmRChar_to_LVAL(res_val, resource)
  723.      GetValues_Union    res_val;
  724.      Resource_Instance* resource;
  725. {
  726.   return (cvchar((int) res_val.char_value));
  727. }
  728.  
  729. static XtArgVal Cvt_LVAL_to_XmRChar(lisp_val, resource, o_widget)
  730.      LVAL               lisp_val;
  731.      Resource_Instance* resource;
  732.      LVAL               o_widget;
  733. {
  734.   return ((XtArgVal) ((char) getchcode(lisp_val)));
  735. }
  736.  
  737. static Resource_Class resclass_XmRChar = {
  738.   XmRChar,
  739.   CHAR,    
  740.   Cvt_XmRChar_to_LVAL,        /* use cvchar of ascii value of character */
  741.   Cvt_LVAL_to_XmRChar};        /* sizeof(char) */
  742.  
  743. #endif                /* WINTERP_MOTIF_11 */
  744.  
  745.  
  746.  
  747. /********************************************************************************/
  748. #ifdef WINTERP_MOTIF_11
  749. static LVAL Cvt_XmRKeySymTable_to_LVAL(res_val, resource)
  750.      GetValues_Union    res_val;
  751.      Resource_Instance* resource;
  752. {
  753.   /*
  754.    * XmRKeySymTable resource XmNbuttonMnemonics  is a create-time only resource.
  755.    * it cannot be retrieved via :GET_VALUES.
  756.    */
  757.   sprintf(temptext,
  758.       "Cannot do :GET_VALUES on resource of type XmR%s.",
  759.       resource->class->XmR_type);
  760.   xlerror(temptext, resource->symbol);
  761. }
  762.  
  763. #define KEYSYMTABLE_SIZE_INCREMENT 20
  764. static XtArgVal Cvt_LVAL_to_XmRKeySymTable(lisp_val, resource, o_widget)
  765.      LVAL               lisp_val;
  766.      Resource_Instance* resource;
  767.      LVAL               o_widget;
  768. {
  769.   int size, i;
  770.   XmKeySymTable keysymtable;
  771.   LVAL elt;
  772.  
  773.   /*
  774.    * if argument is a vector, then step through array, converting each
  775.    * lisp <char> to a C KeySym.
  776.    */
  777.   if (vectorp(lisp_val)) {
  778.     size = getsize(lisp_val);
  779.     keysymtable = (XmKeySymTable) XtMalloc((unsigned) (size * sizeof(KeySym)));
  780.  
  781.     for (i = 0; i < size; i++) {
  782.       elt = getelement(lisp_val, i);
  783.       if (charp(elt))
  784.     keysymtable[i] = (KeySym) getchcode(elt);
  785.       else {
  786.     XtFree(keysymtable);
  787.     sprintf(temptext,
  788.         "Resource %s (type XmR%s) expects a sequence of CHARs -- found a non CHAR element in array.",
  789.         resource->printname,
  790.         resource->class->XmR_type);
  791.     xlerror(temptext, elt);
  792.       }
  793.     }
  794.     Wres_Free_This_Later((XtPointer) keysymtable, XtFree); /* free keysymtable after the resource is set. */
  795.     return ((XtArgVal) keysymtable);
  796.   }
  797.   /*
  798.    * if argument is a list, then cdr through list converting each
  799.    * lisp <char> to a C KeySym.
  800.    */
  801.   else if (consp(lisp_val)) {
  802.     size = KEYSYMTABLE_SIZE_INCREMENT;
  803.     keysymtable = (XmKeySymTable) XtMalloc((unsigned) (size * sizeof(KeySym)));
  804.  
  805.     for (i = 0 ; (consp(lisp_val)) ; lisp_val = cdr(lisp_val), i++) {
  806.       if (i >= size) {        /* make sure it'll fit into allocated keysymtable */
  807.     size += KEYSYMTABLE_SIZE_INCREMENT;
  808.     keysymtable = (XmKeySymTable) XtRealloc(keysymtable, (unsigned) (size * sizeof(KeySym)));
  809.       }
  810.       elt = car(lisp_val);
  811.       if (charp(elt))
  812.     keysymtable[i] = (KeySym) getchcode(elt);
  813.       else {
  814.     XtFree(keysymtable);
  815.     sprintf(temptext,
  816.         "Resource %s (type XmR%s) expects a sequence of CHARs -- found a non CHAR element in list.",
  817.         resource->printname,
  818.         resource->class->XmR_type);
  819.     xlerror(temptext, elt);
  820.       }
  821.     }
  822.  
  823.     if (lisp_val) {        /* if loop terminated due to list pointer not being a CONS cell */
  824.       XtFree(keysymtable);
  825.       sprintf(temptext,
  826.           "Resource %s (type XmR%s) expects a sequence of CHARs -- a non CHAR list-sequence was given.",
  827.           resource->printname,
  828.           resource->class->XmR_type);
  829.       xlerror(temptext, lisp_val);
  830.     }
  831.  
  832.     Wres_Free_This_Later((XtPointer) keysymtable, XtFree); /* free keysymtable after the resource is set. */
  833.     return ((XtArgVal) keysymtable);
  834.   }
  835.   /*
  836.    * if argument wasn't list or vector, then error
  837.    */
  838.   else {
  839.     sprintf(temptext,
  840.         "Resource %s (type XmR%s) expects a sequence/list of CHARs.",
  841.         resource->printname,
  842.         resource->class->XmR_type);
  843.     xlerror(temptext, lisp_val);
  844.   }
  845. }
  846.  
  847. static Resource_Class resclass_XmRKeySymTable = {
  848.   XmRKeySymTable,        /* note that this resource was declared as XmRPointer, but that's not specific enuf... */
  849.   FREE,                /* can either be a vector or a list */
  850.   Cvt_XmRKeySymTable_to_LVAL, 
  851.   Cvt_LVAL_to_XmRKeySymTable};    /* sizeof(XmKeySymTable) */
  852. #endif                /* WINTERP_MOTIF_11 */
  853.  
  854. /********************************************************************************/
  855. #ifdef WINTERP_MOTIF_11
  856. static Resource_Enums XmRCommandWindowLocation_enums_alist[] = {
  857.   {":COMMAND_ABOVE_WORKSPACE",    XmCOMMAND_ABOVE_WORKSPACE,    NULL},
  858.   {":COMMAND_BELOW_WORKSPACE",    XmCOMMAND_BELOW_WORKSPACE,    NULL},
  859.   {NULL, NULL, NULL}
  860. };
  861.  
  862. static Resource_Class resclass_XmRCommandWindowLocation = {
  863.   XmRCommandWindowLocation,    
  864.   SYMBOL,            /* enumerated type */
  865.   Cvt_XtEnum_to_LVAL, 
  866.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  867.   XmRCommandWindowLocation_enums_alist
  868.   };
  869. #endif /* WINTERP_MOTIF_11 */
  870.  
  871.  
  872.  
  873. /********************************************************************************/
  874. static Resource_Enums XmRDefaultButtonType_enums_alist[] = {
  875.   {":DIALOG_OK_BUTTON",        XmDIALOG_OK_BUTTON,    NULL},
  876.   {":DIALOG_CANCEL_BUTTON",    XmDIALOG_CANCEL_BUTTON, NULL},
  877.   {":DIALOG_HELP_BUTTON",    XmDIALOG_HELP_BUTTON,    NULL},
  878.   {NULL, NULL, NULL}
  879. };
  880.  
  881. static Resource_Class resclass_XmRDefaultButtonType = {
  882.   XmRDefaultButtonType,    
  883.   SYMBOL,            /* enumerated type */
  884.   Cvt_XtEnum_to_LVAL, 
  885.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  886.   XmRDefaultButtonType_enums_alist
  887.   };
  888.  
  889.  
  890.  
  891. /********************************************************************************/
  892. static Resource_Enums XmRDeleteResponse_enums_alist[] = {
  893.   {":DESTROY",        XmDESTROY,    NULL},
  894.   {":UNMAP",        XmUNMAP,    NULL},
  895.   {":DO_NOTHING",    XmDO_NOTHING,    NULL},
  896.   {NULL, NULL, NULL}
  897. };
  898.  
  899. static Resource_Class resclass_XmRDeleteResponse = {
  900.   XmRDeleteResponse,    
  901.   SYMBOL,            /* enumerated type */
  902.   Cvt_XtEnum_to_LVAL, 
  903.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  904.   XmRDeleteResponse_enums_alist
  905.   };
  906.  
  907.  
  908.  
  909. /********************************************************************************/
  910. static Resource_Enums XmRDialogStyle_enums_alist[] = {
  911. #ifndef WINTERP_MOTIF_11
  912.   {":DIALOG_WORK_AREA",        XmDIALOG_WORK_AREA,        NULL},
  913.   {":DIALOG_MODELESS",        XmDIALOG_MODELESS,        NULL},
  914.   {":DIALOG_APPLICATION_MODAL",    XmDIALOG_APPLICATION_MODAL,    NULL},
  915.   {":DIALOG_SYSTEM_MODAL",    XmDIALOG_SYSTEM_MODAL,        NULL},
  916. #else
  917.   {":DIALOG_MODELESS",        XmDIALOG_MODELESS,        NULL},
  918.   {":DIALOG_PRIMARY_APPLICATION_MODAL",    XmDIALOG_PRIMARY_APPLICATION_MODAL, NULL},
  919.   /*
  920.    * In motif 1.1, XmDIALOG_APPLICATION_MODAL
  921.    * "is for compatibility only. Its use is deprecated.
  922.    * Since this is obsolete, and conflicts with
  923.    * XmDIALOG_PRIMARY_APPLICATION_MODAL, we obsolete it early.
  924.    *
  925.    {":DIALOG_APPLICATION_MODAL",    XmDIALOG_APPLICATION_MODAL,    NULL}
  926.    */
  927.   {":DIALOG_FULL_APPLICATION_MODAL",    XmDIALOG_FULL_APPLICATION_MODAL, NULL},
  928.   {":DIALOG_SYSTEM_MODAL",        XmDIALOG_SYSTEM_MODAL,        NULL},
  929.   /*
  930.    * In Motif 1.1, XmDIALOG_WORK_AREA has same value (0) as XmDIALOG_MODELESS
  931.    * which means that if you set :DIALOG_WORK_AREA, method :GET_VALUES will
  932.    * retrieve :DIALOG_MODELESS (due to ordering...)
  933.    */
  934.   {":DIALOG_WORK_AREA",            XmDIALOG_WORK_AREA,        NULL},
  935. #endif
  936.   {NULL, NULL, NULL}
  937. };
  938.  
  939. static Resource_Class resclass_XmRDialogStyle = {
  940.   XmRDialogStyle,    
  941.   SYMBOL,            /* enumerated type */
  942.   Cvt_XtEnum_to_LVAL, 
  943.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  944.   XmRDialogStyle_enums_alist
  945.   };
  946.  
  947.  
  948.  
  949. /********************************************************************************/
  950. static Resource_Enums XmRDialogType_enums_alist[] = {
  951. #ifndef WINTERP_MOTIF_11
  952.   {":DIALOG_ERROR",        XmDIALOG_ERROR,        NULL},
  953.   {":DIALOG_INFORMATION",    XmDIALOG_INFORMATION,    NULL},
  954.   {":DIALOG_MESSAGE",        XmDIALOG_MESSAGE,    NULL},
  955.   {":DIALOG_QUESTION",        XmDIALOG_QUESTION,    NULL},
  956.   {":DIALOG_WARNING",        XmDIALOG_WARNING,    NULL},
  957.   {":DIALOG_WORKING",        XmDIALOG_WORKING,    NULL},
  958.   {":DIALOG_PROMPT",        XmDIALOG_PROMPT,    NULL},
  959.   {":DIALOG_SELECTION",        XmDIALOG_SELECTION,    NULL},
  960.   {":DIALOG_COMMAND",        XmDIALOG_COMMAND,    NULL},
  961. #else
  962.   /*
  963.    * MOTIF 1.1 is buggy (what else is new :-(), as it defines multiple symbols
  964.    * with same values.
  965.    * From Xm.h:
  966.    * -- defines for dialog type --
  967.    * #define XmDIALOG_ERROR        1
  968.    * #define XmDIALOG_INFORMATION  2
  969.    * #define XmDIALOG_MESSAGE      3
  970.    * #define XmDIALOG_QUESTION     4
  971.    * #define XmDIALOG_WARNING      5
  972.    * #define XmDIALOG_WORKING      6
  973.    * -- Defines for selection dialog type: --
  974.    * #define XmDIALOG_WORK_AREA      0
  975.    * #define XmDIALOG_PROMPT         1
  976.    * #define XmDIALOG_SELECTION      2
  977.    * #define XmDIALOG_COMMAND        3
  978.    * #define XmDIALOG_FILE_SELECTION 4
  979.    *
  980.    * Stopgap solution is to have method :GET_VALUES return value
  981.    * :DIALOG_ERROR for :DIALOG_PROMPT
  982.    * :DIALOG_INFORMATION for :DIALOG_SELECTION
  983.    * :DIALOG_MESSAGE for :DIALOG_COMMAND
  984.    *
  985.    * Note that for backwards compatibility and sensible naming
  986.    * of resources, I am still allowing method :SET_VALUES to be
  987.    * given values :DIALOG_PROMPT, :DIALOG_SELECTION, and :DIALOG_COMMAND. Note
  988.    * that this will cause a bug for people expecting the values to be eq... 
  989.    */
  990.  {":DIALOG_ERROR",    XmDIALOG_ERROR,        NULL},
  991.  {":DIALOG_INFORMATION",XmDIALOG_INFORMATION,    NULL},
  992.  {":DIALOG_MESSAGE",    XmDIALOG_MESSAGE,    NULL},
  993.  {":DIALOG_QUESTION",    XmDIALOG_QUESTION,    NULL},
  994.  {":DIALOG_WARNING",    XmDIALOG_WARNING,    NULL},
  995.  {":DIALOG_WORKING",    XmDIALOG_WORKING,    NULL},
  996.   /* Motif 1.1 bug -- this value of enumerated type XmRDialogType conflicts w/ XmDIALOG_ERROR */
  997.  {":DIALOG_PROMPT",    XmDIALOG_PROMPT,    NULL},
  998.   /*  Motif 1.1 bug -- this value of enumerated type XmRDialogType conflicts w/ XmDIALOG_INFORMATION */
  999.  {":DIALOG_SELECTION",    XmDIALOG_SELECTION,    NULL},
  1000.   /* Motif 1.1 bug -- this value of enumerated type XmRDialogType conflicts w/ XmDIALOG_MESSAGE */
  1001.  {":DIALOG_COMMAND",    XmDIALOG_COMMAND,    NULL},
  1002.   /* Motif 1.1 bug -- this value of enumerated type XmRDialogType conflicts w/ XmDIALOG_QUESTION */
  1003.  {":DIALOG_FILE_SELECTION", XmDIALOG_FILE_SELECTION, NULL},
  1004. #endif /* WINTERP_MOTIF_11 */
  1005.   {NULL, NULL, NULL}
  1006. };
  1007.  
  1008. static Resource_Class resclass_XmRDialogType = {
  1009.   XmRDialogType,    
  1010.   SYMBOL,            /* enumerated type */
  1011.   Cvt_XtEnum_to_LVAL, 
  1012.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1013.   XmRDialogType_enums_alist
  1014.   };
  1015.  
  1016.  
  1017.  
  1018. /********************************************************************************/
  1019. static LVAL Cvt_XmRDimension_to_LVAL(res_val, resource)
  1020.      GetValues_Union    res_val;
  1021.      Resource_Instance* resource;
  1022. {
  1023.   return (cvfixnum((FIXTYPE) res_val.Dimension_value));
  1024. }
  1025.  
  1026. static XtArgVal Cvt_LVAL_to_XmRDimension(lisp_val, resource, o_widget)
  1027.      LVAL               lisp_val;
  1028.      Resource_Instance* resource;
  1029.      LVAL               o_widget;
  1030. {
  1031.   long value = (long) getfixnum(lisp_val); 
  1032.  
  1033.   /* The Motif 1.0 Xtoolkit intrinsics list Dimension as being the following:
  1034.           typedef Cardinal Dimension; -- Size in pixels -- (where Cardinal == unsigned int)
  1035.      In Motif 1.1, this has changed to 
  1036.           typedef unsigned short Dimension; -- Size in pixels --
  1037.  
  1038.      I'm going with the 'unsigned short' -- for backwards compatibility w/ Motif 1.0, it won't
  1039.      matter if the range of XmRDimension is limited to the range of unsigned shorts...  */
  1040.   
  1041.   Wres_Check_Value_Against_Minimum(value, 0L, resource, lisp_val);
  1042.   Wres_Check_Value_Against_Maximum(value, (long) USHRT_MAX, resource, lisp_val); /* USHRT_MAX is max val of unsigned short from <limits.h> */
  1043.  
  1044.   return ((XtArgVal) ((Dimension) value));
  1045. }
  1046.  
  1047. #ifdef WINTERP_MOTIF_11
  1048.  
  1049. static Resource_Class resclass_XmRVerticalDimension = {
  1050.   XmRVerticalDimension,    
  1051.   FIXNUM,            /* note that only positive FIXNUMS ok */
  1052.   Cvt_XmRDimension_to_LVAL, 
  1053.   Cvt_LVAL_to_XmRDimension};    /* sizeof(Dimension) == sizeof(unsigned short) */
  1054.  
  1055. static Resource_Class resclass_XmRHorizontalDimension = {
  1056.   XmRHorizontalDimension,    
  1057.   FIXNUM,            /* note that only positive FIXNUMS ok */
  1058.   Cvt_XmRDimension_to_LVAL, 
  1059.   Cvt_LVAL_to_XmRDimension};    /* sizeof(Dimension) == sizeof(unsigned short) */
  1060.  
  1061. #else /* MOTIF 1.0 */
  1062.  
  1063. static Resource_Class resclass_XmRDimension = {
  1064.   XmRDimension,    
  1065.   FIXNUM,            /* note that only positive FIXNUMS ok */
  1066.   Cvt_XmRDimension_to_LVAL, 
  1067.   Cvt_LVAL_to_XmRDimension};    /* sizeof(Dimension) == sizeof(unsigned int) */
  1068.  
  1069. #endif                /* WINTERP_MOTIF_11 */
  1070.  
  1071.  
  1072.  
  1073. /********************************************************************************/
  1074. /*
  1075.  * NOTE WORKAROUND TO MOTIF BUG: this enumeration type can't use the general
  1076.  * enumeration converters Cvt_LVAL_to_XtEnum() and Cvt_XtEnum_to_LVAL()
  1077.  * because bugs in the source of Motif 1.0 and 1.1 declare this resource rep type
  1078.  * 'int'. All other enumerated types are declared as 'XtEnum' == 'unsigned char'
  1079.  */
  1080. static Resource_Enums XmREditMode_enums_alist[] = {
  1081.   {":MULTI_LINE_EDIT",    XmMULTI_LINE_EDIT,    NULL},
  1082.   {":SINGLE_LINE_EDIT",    XmSINGLE_LINE_EDIT,    NULL},
  1083.   {NULL, NULL, NULL}
  1084. };
  1085.  
  1086. static Resource_Class resclass_XmREditMode = {
  1087.   XmREditMode,    
  1088.   SYMBOL,            /* enumerated type */
  1089.   Cvt_Enum_Int_to_LVAL, 
  1090.   Cvt_LVAL_to_XtEnum,        /* sizeof(int) !! -- note: this is a Motif BUG v 1.0 and 1.1 */
  1091.   XmREditMode_enums_alist
  1092.   };
  1093.  
  1094.  
  1095.  
  1096. /********************************************************************************/
  1097. #ifdef WINTERP_MOTIF_11
  1098. static Resource_Enums XmRFileTypeMask_enums_alist[] = {
  1099.   {":FILE_DIRECTORY",    XmFILE_DIRECTORY,    NULL},
  1100.   {":FILE_REGULAR",    XmFILE_REGULAR,        NULL},
  1101.   {":FILE_ANY_TYPE",    XmFILE_ANY_TYPE,    NULL},
  1102.   {NULL, NULL, NULL}
  1103. };
  1104.  
  1105. static Resource_Class resclass_XmRFileTypeMask = {
  1106.   XmRFileTypeMask,    
  1107.   SYMBOL,            /* enumerated type */
  1108.   Cvt_XtEnum_to_LVAL, 
  1109.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1110.   XmRFileTypeMask_enums_alist
  1111.   };
  1112. #endif                /* WINTERP_MOTIF_11 */
  1113.  
  1114.  
  1115.  
  1116. /********************************************************************************/
  1117. static LVAL Cvt_XmRFontList_to_LVAL(res_val, resource)
  1118.      GetValues_Union    res_val;
  1119.      Resource_Instance* resource;
  1120. {
  1121.   sprintf(temptext,
  1122.       "Resource %s -- XmR%s --> Lisp type converter not implemented.",
  1123.       resource->printname,
  1124.       resource->class->XmR_type);
  1125.   xlfail(temptext);
  1126. }
  1127. static XtArgVal Cvt_LVAL_to_XmRFontList(lisp_val, resource, o_widget)
  1128.      LVAL               lisp_val;
  1129.      Resource_Instance* resource;
  1130.      LVAL               o_widget;
  1131. {
  1132.   /*
  1133.     Note that all XmFontList resources are copied into the Motif
  1134.     widget's space and thereafter managed by that widget. That
  1135.     means we don't need to worry about making an additional
  1136.     reference to the lisp XmFontList value that was passed in.
  1137.     When the lisp XmString is no longer referenced, it will
  1138.     be freed via garbage collection. 
  1139.     */
  1140.   sprintf(temptext,
  1141.       "Resource %s -- Lisp-->XmR%s type converter not implemented.",
  1142.       resource->printname,
  1143.       resource->class->XmR_type);
  1144.   xlerror(temptext, lisp_val);
  1145. }
  1146. static Resource_Class resclass_XmRFontList = {
  1147.   XmRFontList,    
  1148.   XLTYPE_XmFontList,
  1149.   Cvt_XmRFontList_to_LVAL, 
  1150.   Cvt_LVAL_to_XmRFontList};    /* sizeof (XmFontList) */
  1151.  
  1152.  
  1153.  
  1154. /********************************************************************************/
  1155. static Resource_Enums XmRIndicatorType_enums_alist[] = {
  1156.   {":N_OF_MANY",    XmN_OF_MANY,    NULL},
  1157.   {":ONE_OF_MANY",    XmONE_OF_MANY,    NULL},
  1158.   {NULL, NULL, NULL}
  1159. };
  1160.  
  1161. static Resource_Class resclass_XmRIndicatorType = {
  1162.   XmRIndicatorType,    
  1163.   SYMBOL,            /* enumerated type */
  1164.   Cvt_XtEnum_to_LVAL, 
  1165.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1166.   XmRIndicatorType_enums_alist
  1167.   };
  1168.  
  1169.  
  1170.  
  1171. /********************************************************************************/
  1172. #ifdef WINTERP_MOTIF_11
  1173. /*
  1174.  * Need to include <X11/StringDefs.h> because Motif 1.1 <Xm/Xm.h> forgot
  1175.  * to define resource representation type XtRInitialState/XmRInitialState.
  1176.  */
  1177. #include <X11/StringDefs.h>
  1178.  
  1179. /*
  1180.  * NOTE WORKAROUND TO Xt BUG: this enumeration type can't use the general
  1181.  * enumeration converters Cvt_LVAL_to_XtEnum() and Cvt_XtEnum_to_LVAL()
  1182.  * because bugs in the source of the X11r4 Xt/Shell.c declare this resource
  1183.  * rep type 'int'. All other enumerated types are declared as
  1184.  * 'XtEnum' == 'unsigned char'
  1185.  */
  1186. static Resource_Enums XtRInitialState_enums_alist[] = {
  1187.   {":WITHDRAWN_STATE",    WithdrawnState,    NULL},
  1188.   {":NORMAL_STATE",    NormalState,    NULL},
  1189.   {":ICONIC_STATE",    IconicState,    NULL},
  1190.   {NULL, NULL, NULL}
  1191. };
  1192.  
  1193. static Resource_Class resclass_XtRInitialState = {
  1194.   XtRInitialState,
  1195.   SYMBOL,            /* enumerated type */
  1196.   Cvt_Enum_Int_to_LVAL,
  1197.   Cvt_LVAL_to_XtEnum,        /* sizeof(int)!! -- note: this is a BUG in Xt/Shell.c */
  1198.   XtRInitialState_enums_alist
  1199.   };
  1200. #endif /* WINTERP_MOTIF_11 */
  1201.  
  1202.  
  1203. /********************************************************************************/
  1204. static LVAL Cvt_XmRInt_to_LVAL(res_val, resource)
  1205.      GetValues_Union    res_val;
  1206.      Resource_Instance* resource;
  1207. {
  1208.   return (cvfixnum((FIXTYPE) res_val.int_value));
  1209. }
  1210.  
  1211. static XtArgVal Cvt_LVAL_to_XmRInt(lisp_val, resource, o_widget)
  1212.      LVAL               lisp_val;
  1213.      Resource_Instance* resource;
  1214.      LVAL               o_widget;
  1215. {
  1216.   long value = (long) getfixnum(lisp_val); 
  1217.  
  1218.   Wres_Check_Value_Against_Minimum(value, (long) INT_MIN, resource, lisp_val); /* INT_MIN is min val of int from <limits.h> */
  1219.   Wres_Check_Value_Against_Maximum(value, (long) INT_MAX, resource, lisp_val); /* INT_MAX is max val of int from <limits.h> */
  1220.  
  1221.   return ((XtArgVal) ((int) value));
  1222. }
  1223.  
  1224. static Resource_Class resclass_XmRInt = {
  1225.   XmRInt,
  1226.   FIXNUM,
  1227.   Cvt_XmRInt_to_LVAL,
  1228.   Cvt_LVAL_to_XmRInt};        /* sizeof(int) */
  1229.  
  1230. #ifdef WINTERP_MOTIF_11
  1231.  
  1232. static Resource_Class resclass_XmRHorizontalInt = {
  1233.   XmRHorizontalInt,
  1234.   FIXNUM,
  1235.   Cvt_XmRInt_to_LVAL,
  1236.   Cvt_LVAL_to_XmRInt};        /* sizeof(int) */
  1237.  
  1238. static Resource_Class resclass_XmRVerticalInt = {
  1239.   XmRVerticalInt,
  1240.   FIXNUM,
  1241.   Cvt_XmRInt_to_LVAL,
  1242.   Cvt_LVAL_to_XmRInt};        /* sizeof(int) */
  1243.  
  1244. #endif                /* WINTERP_MOTIF_11 */
  1245.  
  1246. /********************************************************************************/
  1247. static Resource_Enums XmRKeyboardFocusPolicy_enums_alist[] = {
  1248.   {":EXPLICIT",        XmEXPLICIT,    NULL},
  1249.   {":POINTER",        XmPOINTER,    NULL},
  1250.   {NULL, NULL, NULL}
  1251. };
  1252.  
  1253. static Resource_Class resclass_XmRKeyboardFocusPolicy = {
  1254.   XmRKeyboardFocusPolicy,    
  1255.   SYMBOL,            /* enumerated type */
  1256.   Cvt_XtEnum_to_LVAL, 
  1257.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1258.   XmRKeyboardFocusPolicy_enums_alist
  1259.   };
  1260.  
  1261.  
  1262.  
  1263. /********************************************************************************/
  1264. static Resource_Enums XmRLabelType_enums_alist[] = {
  1265.   {":PIXMAP",    XmPIXMAP,    NULL},
  1266.   {":STRING",    XmSTRING,    NULL},
  1267.   {NULL, NULL, NULL}
  1268. };
  1269.  
  1270. static Resource_Class resclass_XmRLabelType = {
  1271.   XmRLabelType,    
  1272.   SYMBOL,            /* enumerated type */
  1273.   Cvt_XtEnum_to_LVAL, 
  1274.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1275.   XmRLabelType_enums_alist
  1276.   };
  1277.  
  1278.  
  1279.  
  1280. /********************************************************************************/
  1281. static Resource_Enums XmRListSizePolicy_enums_alist[] = {
  1282.   {":VARIABLE",            XmVARIABLE,        NULL},
  1283.   {":CONSTANT",            XmCONSTANT,        NULL},
  1284.   {":RESIZE_IF_POSSIBLE",    XmRESIZE_IF_POSSIBLE,    NULL},
  1285.   {NULL, NULL, NULL}
  1286. };
  1287.  
  1288. static Resource_Class resclass_XmRListSizePolicy = {
  1289.   XmRListSizePolicy,    
  1290.   SYMBOL,            /* enumerated type */
  1291.   Cvt_XtEnum_to_LVAL, 
  1292.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1293.   XmRListSizePolicy_enums_alist
  1294.   };
  1295.  
  1296.  
  1297.  
  1298. /********************************************************************************/
  1299. #ifdef WINTERP_MOTIF_11
  1300. static Resource_Enums XmRMultiClick_enums_alist[] = {
  1301.   {":MULTICLICK_DISCARD",    XmMULTICLICK_DISCARD,    NULL},
  1302.   {":MULTICLICK_KEEP",        XmMULTICLICK_KEEP,    NULL},
  1303.   {NULL, NULL, NULL}
  1304. };
  1305.  
  1306. static Resource_Class resclass_XmRMultiClick = {
  1307.   XmRMultiClick,    
  1308.   SYMBOL,            /* enumerated type */
  1309.   Cvt_XtEnum_to_LVAL, 
  1310.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1311.   XmRMultiClick_enums_alist
  1312.   };
  1313. #endif                /* WINTERP_MOTIF_11 */
  1314.  
  1315.  
  1316.  
  1317. /********************************************************************************/
  1318. #ifdef WINTERP_MOTIF_11
  1319. static Resource_Enums XmRNavigationType_enums_alist[] = {
  1320. #ifdef WINTERP_MOTIF_111    /* a new navigation type symbol added in 1.1.1 */
  1321.   {":DYNAMIC_DEFAULT_TAB_GROUP",XmDYNAMIC_DEFAULT_TAB_GROUP,NULL},
  1322. #endif WINTERP_MOTIF_111
  1323.   {":NONE",            XmNONE,            NULL},
  1324.   {":TAB_GROUP",        XmTAB_GROUP,        NULL},
  1325.   {":STICKY_TAB_GROUP",        XmSTICKY_TAB_GROUP,    NULL},
  1326.   {":EXCLUSIVE_TAB_GROUP",    XmEXCLUSIVE_TAB_GROUP,    NULL},
  1327.   {NULL, NULL, NULL}
  1328. };
  1329.  
  1330. static Resource_Class resclass_XmRNavigationType = {
  1331.   XmRNavigationType,    
  1332.   SYMBOL,            /* enumerated type */
  1333.   Cvt_XtEnum_to_LVAL, 
  1334.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1335.   XmRNavigationType_enums_alist
  1336.   };
  1337. #endif                /* WINTERP_MOTIF_11 */
  1338.  
  1339.  
  1340.  
  1341. /********************************************************************************/
  1342. static Resource_Enums XmROrientation_enums_alist[] = {
  1343.   {":NO_ORIENTATION",    XmNO_ORIENTATION,    NULL},
  1344.   {":VERTICAL",        XmVERTICAL,        NULL},
  1345.   {":HORIZONTAL",    XmHORIZONTAL,        NULL},
  1346.   {NULL, NULL, NULL}
  1347. };
  1348.  
  1349. static Resource_Class resclass_XmROrientation = {
  1350.   XmROrientation,    
  1351.   SYMBOL,            /* enumerated type */
  1352.   Cvt_XtEnum_to_LVAL, 
  1353.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1354.   XmROrientation_enums_alist
  1355.   };
  1356.  
  1357.  
  1358.  
  1359. /********************************************************************************/
  1360. static Resource_Enums XmRPacking_enums_alist[] = {
  1361.   {":NO_PACKING",    XmNO_PACKING,    NULL},
  1362.   {":PACK_TIGHT",    XmPACK_TIGHT,    NULL},
  1363.   {":PACK_COLUMN",    XmPACK_COLUMN,    NULL},
  1364.   {":PACK_NONE",    XmPACK_NONE,    NULL},
  1365.   {NULL, NULL, NULL}
  1366. };
  1367.  
  1368. static Resource_Class resclass_XmRPacking = {
  1369.   XmRPacking,    
  1370.   SYMBOL,            /* enumerated type */
  1371.   Cvt_XtEnum_to_LVAL, 
  1372.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1373.   XmRPacking_enums_alist
  1374.   };
  1375.  
  1376.  
  1377.  
  1378. /********************************************************************************/
  1379. static LVAL Cvt_XmRPixel_to_LVAL(res_val, resource)
  1380.      GetValues_Union    res_val;
  1381.      Resource_Instance* resource;
  1382. {
  1383.   return (cv_pixel((Pixel) res_val.XtPointer_value));
  1384. }
  1385.  
  1386. static XtArgVal Cvt_LVAL_to_XmRPixel(lisp_val, resource, o_widget)
  1387.      LVAL               lisp_val;
  1388.      Resource_Instance* resource;
  1389.      LVAL               o_widget;
  1390. {
  1391.   return ((XtArgVal) get_pixel(lisp_val));
  1392. }
  1393.  
  1394. static Resource_Class resclass_XmRPixel = {
  1395.   XmRPixel,
  1396.   XLTYPE_Pixel,
  1397.   Cvt_XmRPixel_to_LVAL, 
  1398.   Cvt_LVAL_to_XmRPixel};    /* sizeof(Pixel) */
  1399.  
  1400.  
  1401. /********************************************************************************/
  1402. static LVAL Cvt_Pixmap_to_LVAL(res_val, resource)
  1403.      GetValues_Union    res_val;
  1404.      Resource_Instance* resource;
  1405. {
  1406.   return (res_val.XtPointer_value ? cv_pixmap((Pixmap) res_val.XtPointer_value) : NIL);
  1407. }
  1408.  
  1409. static XtArgVal Cvt_LVAL_to_Pixmap(lisp_val, resource, o_widget)
  1410.      LVAL lisp_val;        /* XLTYPE_Pixmap */
  1411.      Resource_Instance* resource;
  1412.      LVAL               o_widget;
  1413. {
  1414.   extern void Wpm_Set_Pixmap_Reference(); /* w_pixmap.c */
  1415.   
  1416.   /* pixmap is referenced inside widget, so don't allow pixmap to be garbage
  1417.      collected & XmDestroyPixmap()'d until it is no longer referenced by
  1418.      anybody. */
  1419.   Wpm_Set_Pixmap_Reference(lisp_val, o_widget, resource->symbol);
  1420.  
  1421.   return ((XtArgVal) get_pixmap(lisp_val));
  1422. }
  1423.  
  1424. #ifdef WINTERP_MOTIF_11
  1425. static Resource_Class resclass_XmRXmBackgroundPixmap = {
  1426.   XmRXmBackgroundPixmap,
  1427.   XLTYPE_Pixmap,
  1428.   Cvt_Pixmap_to_LVAL,
  1429.   Cvt_LVAL_to_Pixmap};    /* sizeof(Pixmap) == sizeof(unsigned long) */
  1430. #else                /* MOTIF 1.0 */
  1431. static Resource_Class resclass_XmRPixmap = {
  1432.   XmRPixmap,
  1433.   XLTYPE_Pixmap,
  1434.   Cvt_Pixmap_to_LVAL,
  1435.   Cvt_LVAL_to_Pixmap};    /* sizeof(Pixmap) == sizeof(unsigned long) */
  1436. #endif                /* WINTERP_MOTIF_11 */
  1437.  
  1438. static Resource_Class resclass_ForegroundPixmap = {
  1439.   "ForegroundPixmap",        /* == XmRManForegroundPixmap + XmRPrimForegroundPixmap + XmRGadgetPixmap */
  1440.   XLTYPE_Pixmap,
  1441.   Cvt_Pixmap_to_LVAL,
  1442.   Cvt_LVAL_to_Pixmap};
  1443.  
  1444. static Resource_Class resclass_HighlightPixmap = {
  1445.   "HighlightPixmap",        /* == XmRPrimHighlightPixmap + XmRManHighlightPixmap */
  1446.   XLTYPE_Pixmap,
  1447.   Cvt_Pixmap_to_LVAL,
  1448.   Cvt_LVAL_to_Pixmap};
  1449.  
  1450. static Resource_Class resclass_TopShadowPixmap = {
  1451.   "TopShadowPixmap",        /* == XmRPrimTopShadowPixmap + XmRManTopShadowPixmap */
  1452.   XLTYPE_Pixmap,
  1453.   Cvt_Pixmap_to_LVAL,
  1454.   Cvt_LVAL_to_Pixmap};
  1455.  
  1456. static Resource_Class resclass_BottomShadowPixmap = {
  1457.   "BottomShadowPixmap",        /* == XmRPrimBottomShadowPixmap + XmRManBottomShadowPixmap */
  1458.   XLTYPE_Pixmap, 
  1459.   Cvt_Pixmap_to_LVAL, 
  1460.   Cvt_LVAL_to_Pixmap};
  1461.  
  1462.  
  1463.  
  1464. /********************************************************************************/
  1465. static LVAL Cvt_XmRPosition_to_LVAL(res_val, resource)
  1466.      GetValues_Union    res_val;
  1467.      Resource_Instance* resource;
  1468. {
  1469.   return (cvfixnum((FIXTYPE) res_val.Position_value));
  1470. }
  1471.  
  1472. static XtArgVal Cvt_LVAL_to_XmRPosition(lisp_val, resource, o_widget)
  1473.      LVAL               lisp_val;
  1474.      Resource_Instance* resource;
  1475.      LVAL               o_widget;
  1476. {
  1477.   long value = (long) getfixnum(lisp_val);
  1478.  
  1479.   /* The Motif 1.0 Xtoolkit intrinsics list Position as being the following:
  1480.           typedef int Position;  -- Offset from 0 coordinate --
  1481.      In Motif 1.1, this has changed to 
  1482.           typedef short Position; -- Offset from 0 coordinate --
  1483.  
  1484.      I'm going with the 'short' -- for backwards compatibility w/ Motif 1.0, it won't
  1485.      matter if the range of XmRPosition is limited to the range of shorts...  */
  1486.  
  1487.   Wres_Check_Value_Against_Minimum(value, (long) SHRT_MIN, resource, lisp_val);
  1488.   Wres_Check_Value_Against_Maximum(value, (long) SHRT_MAX, resource, lisp_val);
  1489.  
  1490.   return ((XtArgVal) ((Position) value));
  1491. }
  1492.  
  1493. #ifdef WINTERP_MOTIF_11
  1494. static Resource_Class resclass_XmRHorizontalPosition = {
  1495.   XmRHorizontalPosition,
  1496.   FIXNUM,
  1497.   Cvt_XmRPosition_to_LVAL,
  1498.   Cvt_LVAL_to_XmRPosition};    /* sizeof(Position): in Motif 1.1 == sizeof(short) */
  1499. static Resource_Class resclass_XmRVerticalPosition = {
  1500.   XmRVerticalPosition,
  1501.   FIXNUM,
  1502.   Cvt_XmRPosition_to_LVAL,
  1503.   Cvt_LVAL_to_XmRPosition};    /* sizeof(Position): in Motif 1.1 == sizeof(short) */
  1504. #else                /* MOTIF 1.0 */
  1505. static Resource_Class resclass_XmRPosition = {
  1506.   XmRPosition,
  1507.   FIXNUM,
  1508.   Cvt_XmRPosition_to_LVAL,
  1509.   Cvt_LVAL_to_XmRPosition};    /* sizeof(Position): in Motif 1.0 == sizeof(int) */
  1510. #endif                /* WINTERP_MOTIF_11 */
  1511.  
  1512.  
  1513.  
  1514. /********************************************************************************/
  1515. static Resource_Enums XmRProcessingDirection_enums_alist[] = {
  1516.   {":MAX_ON_TOP",    XmMAX_ON_TOP,    NULL},
  1517.   {":MAX_ON_BOTTOM",    XmMAX_ON_BOTTOM,NULL},
  1518.   {":MAX_ON_LEFT",    XmMAX_ON_LEFT,    NULL},
  1519.   {":MAX_ON_RIGHT",    XmMAX_ON_RIGHT,    NULL},
  1520.   {NULL, NULL, NULL}
  1521. };
  1522.  
  1523. static Resource_Class resclass_XmRProcessingDirection = {
  1524.   XmRProcessingDirection,    
  1525.   SYMBOL,            /* enumerated type */
  1526.   Cvt_XtEnum_to_LVAL, 
  1527.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1528.   XmRProcessingDirection_enums_alist
  1529.   };
  1530.  
  1531.  
  1532.  
  1533. /********************************************************************************/
  1534. static Resource_Enums XmRResizePolicy_enums_alist[] = {
  1535.   {":RESIZE_NONE",    XmRESIZE_NONE,    NULL},
  1536.   {":RESIZE_GROW",    XmRESIZE_GROW,    NULL},
  1537.   {":RESIZE_ANY",    XmRESIZE_ANY,    NULL},
  1538.   {NULL, NULL, NULL}
  1539. };
  1540.  
  1541. static Resource_Class resclass_XmRResizePolicy = {
  1542.   XmRResizePolicy,    
  1543.   SYMBOL,            /* enumerated type */
  1544.   Cvt_XtEnum_to_LVAL, 
  1545.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1546.   XmRResizePolicy_enums_alist
  1547.   };
  1548.  
  1549.  
  1550.  
  1551. /********************************************************************************/
  1552. static Resource_Enums XmRRowColumnType_enums_alist[] = {
  1553.   {":WORK_AREA",    XmWORK_AREA,    NULL},
  1554.   {":MENU_BAR",        XmMENU_BAR,    NULL},
  1555.   {":MENU_PULLDOWN",    XmMENU_PULLDOWN,NULL},
  1556.   {":MENU_POPUP",    XmMENU_POPUP,    NULL},
  1557.   {":MENU_OPTION",    XmMENU_OPTION,    NULL},
  1558.   {NULL, NULL, NULL}
  1559. };
  1560.  
  1561. static Resource_Class resclass_XmRRowColumnType = {
  1562.   XmRRowColumnType,    
  1563.   SYMBOL,            /* enumerated type */
  1564.   Cvt_XtEnum_to_LVAL, 
  1565.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1566.   XmRRowColumnType_enums_alist
  1567.   };
  1568.  
  1569.  
  1570.  
  1571. /********************************************************************************/
  1572. static Resource_Enums XmRScrollBarDisplayPolicy_enums_alist[] = {
  1573.   {":AS_NEEDED",    XmAS_NEEDED,    NULL},
  1574.   {":STATIC",        XmSTATIC,    NULL},
  1575.   {NULL, NULL, NULL}
  1576. };
  1577.  
  1578. static Resource_Class resclass_XmRScrollBarDisplayPolicy = {
  1579.   XmRScrollBarDisplayPolicy,    
  1580.   SYMBOL,            /* enumerated type */
  1581.   Cvt_XtEnum_to_LVAL, 
  1582.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1583.   XmRScrollBarDisplayPolicy_enums_alist
  1584.   };
  1585.  
  1586.  
  1587.  
  1588. /********************************************************************************/
  1589. static Resource_Enums XmRScrollBarPlacement_enums_alist[] = {
  1590.   {":TOP_LEFT",        XmTOP_LEFT,    NULL},
  1591.   {":TOP_RIGHT",    XmTOP_RIGHT,    NULL},
  1592.   {":BOTTOM_LEFT",    XmBOTTOM_LEFT,    NULL},
  1593.   {":BOTTOM_RIGHT",    XmBOTTOM_RIGHT,    NULL},
  1594.   {NULL, NULL, NULL}
  1595. };
  1596.  
  1597. static Resource_Class resclass_XmRScrollBarPlacement = {
  1598.   XmRScrollBarPlacement,    
  1599.   SYMBOL,            /* enumerated type */
  1600.   Cvt_XtEnum_to_LVAL, 
  1601.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1602.   XmRScrollBarPlacement_enums_alist
  1603.   };
  1604.  
  1605.  
  1606.  
  1607. /********************************************************************************/
  1608. static Resource_Enums XmRScrollingPolicy_enums_alist[] = {
  1609.   {":AUTOMATIC",        XmAUTOMATIC,        NULL},
  1610.   {":APPLICATION_DEFINED",    XmAPPLICATION_DEFINED,    NULL},
  1611.   {NULL, NULL, NULL}
  1612. };
  1613.  
  1614. static Resource_Class resclass_XmRScrollingPolicy = {
  1615.   XmRScrollingPolicy,    
  1616.   SYMBOL,            /* enumerated type */
  1617.   Cvt_XtEnum_to_LVAL, 
  1618.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1619.   XmRScrollingPolicy_enums_alist
  1620.   };
  1621.  
  1622.  
  1623.  
  1624. /********************************************************************************/
  1625. static LVAL Cvt_XmRSelectionArray_to_LVAL(res_val, resource)
  1626.      GetValues_Union    res_val;
  1627.      Resource_Instance* resource;
  1628. {
  1629.   /*
  1630.    * XmRSelectionArray resource XmNselectionArray cannot be retrieved
  1631.    * via :GET_VALUES because it isn't null terminated. To retrieve this,
  1632.    * create a method :GET_SELECTION_ARRAY on XM_TEXT_*_WIDGET_CLASS...
  1633.    */
  1634.   sprintf(temptext,
  1635.       "Cannot do :GET_VALUES on resource of type XmR%s.",
  1636.       resource->class->XmR_type);
  1637.   xlerror(temptext, resource->symbol);
  1638. }
  1639.  
  1640. static Resource_Enums XmTextScanType_enums_alist[] = {
  1641.   {":SELECT_POSITION",    XmSELECT_POSITION,    NULL},
  1642.   {":SELECT_WHITESPACE",XmSELECT_WHITESPACE,    NULL},
  1643.   {":SELECT_WORD",    XmSELECT_WORD,        NULL},
  1644.   {":SELECT_LINE",    XmSELECT_LINE,        NULL},
  1645.   {":SELECT_ALL",    XmSELECT_ALL,        NULL},
  1646. #ifdef WINTERP_MOTIF_11
  1647.   {":SELECT_PARAGRAPH",    XmSELECT_PARAGRAPH,    NULL},
  1648. #endif                /* WINTERP_MOTIF_11 */
  1649.   {NULL, NULL, NULL}
  1650. };
  1651.  
  1652. /*
  1653.  * This procedure was mutated from Cvt_LVAL_to_XtEnum(). Couldn't
  1654.  * use Cvt_LVAL_to_XtEnum() directly because we need to call XtFree()
  1655.  * on the <selarray> parameter before signaling an error.
  1656.  *
  1657.  * Note: this is very similar to Cvt_LVAL_to_XmRButtonType()
  1658.  * if changing/fixing this, fix the other. These should be merged, but I'm lazy.
  1659.  */
  1660. static XmTextScanType Cvt_LVAL_to_XmTextScanType(lisp_val, resource, selarray)
  1661.      LVAL               lisp_val;
  1662.      Resource_Instance* resource;
  1663.      XmTextScanType*    selarray;
  1664. {
  1665.   register Resource_Enums* alist = &(XmTextScanType_enums_alist[0]);
  1666.  
  1667.   while (alist->printname && (lisp_val != alist->lisp_value))
  1668.     alist++;
  1669.   if (alist->printname)        /* if not at end of alist, then (alist->lisp_value == lisp_val) */
  1670.     return ((XmTextScanType) alist->c_value); /* return the C value assoc'd w/ lisp_val */
  1671.   else {            /* else give error message */
  1672.     char* cptr;
  1673.  
  1674.     XtFree(selarray);        /* must free the selectionarray created below in Cvt_LVAL_to_XmRSelectionArray() */
  1675.  
  1676.     sprintf(temptext,
  1677.         "Note: Resources of type XmR%s may only be set to the following enumerated values:\n",
  1678.         resource->class->XmR_type);
  1679.     errputstr(temptext);
  1680.  
  1681.     alist = &(XmTextScanType_enums_alist[0]);
  1682.     cptr = &(temptext[0]);
  1683.     *cptr++ = '\t';
  1684.     *cptr++ = '[';
  1685.     while (alist->printname) {
  1686.       int len = strlen(alist->printname);
  1687.       strncpy(cptr, alist->printname, len);
  1688.       cptr += len;
  1689.       *cptr++ = ' ';
  1690.       alist++;
  1691.     }
  1692.     *cptr++ = ']';
  1693.     *cptr++ = '\n';
  1694.     *cptr++ = '\000';
  1695.     errputstr(temptext); 
  1696.  
  1697.     sprintf(temptext,
  1698.         "Attempted to set resource %s of type XmR%s to invalid value (see note above).",
  1699.         resource->printname,
  1700.         resource->class->XmR_type);
  1701.     xlerror(temptext, lisp_val);
  1702.   }
  1703. }
  1704.  
  1705. #define SELECTIONARRAY_SIZE_INCREMENT 20
  1706. static XtArgVal Cvt_LVAL_to_XmRSelectionArray(lisp_val, resource, o_widget)
  1707.      LVAL               lisp_val;
  1708.      Resource_Instance* resource;
  1709.      LVAL               o_widget;
  1710. {
  1711.   int size, i;
  1712.   XmTextScanType* selarray;
  1713.  
  1714.   /*
  1715.    * if argument is a vector, then step through array, converting each
  1716.    * lisp text scan type symbol to a C XmTextScanType enum.
  1717.    */
  1718.   if (vectorp(lisp_val)) {
  1719.     size = getsize(lisp_val);
  1720.     selarray = (XmTextScanType*) XtMalloc((unsigned) (size * sizeof(XmTextScanType)));
  1721.  
  1722.     for (i = 0; i < size; i++)
  1723.       selarray[i] = Cvt_LVAL_to_XmTextScanType(getelement(lisp_val, i), resource, selarray); /* will free selarray if this proc. signalls an error */
  1724.  
  1725.     Wres_Free_This_Later((XtPointer) selarray, XtFree); /* free selarray after the resource is set. */
  1726.     return ((XtArgVal) selarray);
  1727.   }
  1728.   /*
  1729.    * if argument is a list, then cdr through list converting each
  1730.    * lisp text scan type symbol to a C XmTextScanType enum.
  1731.    */
  1732.   else if (consp(lisp_val)) {
  1733.     size = SELECTIONARRAY_SIZE_INCREMENT;
  1734.     selarray = (XmTextScanType*) XtMalloc((unsigned) (size * sizeof(XmTextScanType)));
  1735.  
  1736.     for (i = 0 ; (consp(lisp_val)) ; lisp_val = cdr(lisp_val), i++) {
  1737.       if (i >= size) {        /* make sure it'll fit into allocated selarray */
  1738.     size += SELECTIONARRAY_SIZE_INCREMENT;
  1739.     selarray = (XmTextScanType*) XtRealloc(selarray, (unsigned) (size * sizeof(XmTextScanType))); /* will free selarray if this proc. signalls an error */
  1740.       }
  1741.       selarray[i] = Cvt_LVAL_to_XmTextScanType(car(lisp_val), resource, selarray);
  1742.     }
  1743.     if (lisp_val) {        /* if loop terminated due to list pointer not being a CONS cell */
  1744.       XtFree(selarray);
  1745.       sprintf(temptext,
  1746.           "Resource %s (type XmR%s) expected a list of XmTextScanType keywords -- found invalid XmRSelectionArray list element.",
  1747.           resource->printname,
  1748.           resource->class->XmR_type);
  1749.       xlerror(temptext, lisp_val);
  1750.     }
  1751.     Wres_Free_This_Later((XtPointer) selarray, XtFree); /* free selarray after the resource is set. */
  1752.     return ((XtArgVal) selarray);
  1753.   }
  1754.   /*
  1755.    * if argument wasn't list or vector, then error
  1756.    */
  1757.   else {
  1758.     sprintf(temptext,
  1759.         "Resource %s (type XmR%s) expected a list or vector of XmTextScanType keywords.",
  1760.         resource->printname,
  1761.         resource->class->XmR_type);
  1762.     xlerror(temptext, lisp_val);
  1763.   }
  1764. }
  1765.  
  1766. static Resource_Class resclass_XmRSelectionArray = {
  1767.   "SelectionArray",        /* note that this resource was declared as XmRPointer, but that's not specific enuf... */
  1768.   FREE,                /* can either be a vector or a list */
  1769.   Cvt_XmRSelectionArray_to_LVAL, 
  1770.   Cvt_LVAL_to_XmRSelectionArray}; /* sizeof(XmTextScanType*) /
  1771.  
  1772.  
  1773.  
  1774. /********************************************************************************/
  1775. static Resource_Enums XmRSelectionPolicy_enums_alist[] = {
  1776.   {":SINGLE_SELECT",    XmSINGLE_SELECT,    NULL},
  1777.   {":MULTIPLE_SELECT",    XmMULTIPLE_SELECT,    NULL},
  1778.   {":EXTENDED_SELECT",    XmEXTENDED_SELECT,    NULL},
  1779.   {":BROWSE_SELECT",    XmBROWSE_SELECT,    NULL},
  1780.   {NULL, NULL, NULL}
  1781. };
  1782.  
  1783. static Resource_Class resclass_XmRSelectionPolicy = {
  1784.   XmRSelectionPolicy,    
  1785.   SYMBOL,            /* enumerated type */
  1786.   Cvt_XtEnum_to_LVAL, 
  1787.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1788.   XmRSelectionPolicy_enums_alist
  1789.   };
  1790.  
  1791.  
  1792.  
  1793. /********************************************************************************/
  1794. static Resource_Enums XmRSeparatorType_enums_alist[] = {
  1795.   {":NO_LINE",            XmNO_LINE,        NULL},
  1796.   {":SINGLE_LINE",        XmSINGLE_LINE,        NULL},
  1797.   {":DOUBLE_LINE",        XmDOUBLE_LINE,        NULL},
  1798.   {":SINGLE_DASHED_LINE",    XmSINGLE_DASHED_LINE,    NULL},
  1799.   {":DOUBLE_DASHED_LINE",    XmDOUBLE_DASHED_LINE,    NULL},
  1800.   {":SHADOW_ETCHED_OUT",    XmSHADOW_ETCHED_OUT,    NULL},
  1801.   {":SHADOW_ETCHED_IN",        XmSHADOW_ETCHED_IN,    NULL},
  1802.   {NULL, NULL, NULL}
  1803. };
  1804.  
  1805. static Resource_Class resclass_XmRSeparatorType = {
  1806.   XmRSeparatorType,    
  1807.   SYMBOL,            /* enumerated type */
  1808.   Cvt_XtEnum_to_LVAL, 
  1809.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1810.   XmRSeparatorType_enums_alist
  1811.   };
  1812.  
  1813.  
  1814.  
  1815. /********************************************************************************/
  1816. static Resource_Enums XmRShadowType_enums_alist[] = {
  1817.   {":SHADOW_ETCHED_IN",        XmSHADOW_ETCHED_IN,    NULL},
  1818.   {":SHADOW_ETCHED_OUT",    XmSHADOW_ETCHED_OUT,    NULL},
  1819.   {":SHADOW_IN",        XmSHADOW_IN,        NULL},
  1820.   {":SHADOW_OUT",        XmSHADOW_OUT,        NULL},
  1821.   {NULL, NULL, NULL}
  1822. };
  1823.  
  1824. static Resource_Class resclass_XmRShadowType = {
  1825.   XmRShadowType,    
  1826.   SYMBOL,            /* enumerated type */
  1827.   Cvt_XtEnum_to_LVAL, 
  1828.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1829.   XmRShadowType_enums_alist
  1830.   };
  1831.  
  1832.  
  1833.  
  1834. /********************************************************************************/
  1835.  
  1836. static LVAL Cvt_XmRShort_to_LVAL(res_val, resource)
  1837.      GetValues_Union    res_val;
  1838.      Resource_Instance* resource;
  1839. {
  1840.   return (cvfixnum((FIXTYPE) res_val.short_value));
  1841. }
  1842.  
  1843. static XtArgVal Cvt_LVAL_to_XmRShort(lisp_val, resource, o_widget)
  1844.      LVAL               lisp_val;
  1845.      Resource_Instance* resource;
  1846.      LVAL               o_widget;
  1847. {
  1848.   long value = (long) getfixnum(lisp_val); 
  1849.  
  1850.   Wres_Check_Value_Against_Minimum(value, (long) SHRT_MIN, resource, lisp_val);
  1851.   Wres_Check_Value_Against_Maximum(value, (long) SHRT_MAX, resource, lisp_val);
  1852.  
  1853.   return ((XtArgVal) ((short) value));
  1854. }
  1855.  
  1856. static Resource_Class resclass_XmRShort = {
  1857.   XmRShort,
  1858.   FIXNUM,
  1859.   Cvt_XmRShort_to_LVAL,
  1860.   Cvt_LVAL_to_XmRShort};    /* sizeof(short) */
  1861.  
  1862.  
  1863.  
  1864. /********************************************************************************/
  1865. /*
  1866.  * For getvalues, I'm assuming that we need to create our own copy of the string
  1867.  * in lisp and that the returned string is just a pointer into the widget's 
  1868.  * "memory space". I'm assuming that the string returned by getvalues does not
  1869.  * need to be deallocated.
  1870.  */
  1871. static LVAL Cvt_XmRString_to_LVAL(res_val, resource)
  1872.      GetValues_Union    res_val;
  1873.      Resource_Instance* resource;
  1874. {
  1875.   return (res_val.String_value ? cvstring((char*) res_val.String_value) : NIL);
  1876. }
  1877.  
  1878. /* 
  1879.  * For setvalues and widget creation, I'm assuming that all string valued arguments
  1880.  * get copied in the widget, or are just temporarily referenced. Cases where this
  1881.  * doesn't happen should be considered a Motif bug. The reason to be concerned is
  1882.  * that Strings no longer being referenced are good candidates for being garbage
  1883.  * collected sometime later (the next time cons() or newnode() is called, for example).
  1884.  * Passing the string into setvalues/create  doesn't  count as a reference...
  1885. */
  1886. static XtArgVal Cvt_LVAL_to_XmRString(lisp_val, resource, o_widget)
  1887.      LVAL               lisp_val;
  1888.      Resource_Instance* resource;
  1889.      LVAL               o_widget;
  1890. {
  1891.   return ((XtArgVal) ((String) getstring(lisp_val)));
  1892. }
  1893.  
  1894. static Resource_Class resclass_XmRString = {
  1895.   XmRString,
  1896.   STRING,
  1897.   Cvt_XmRString_to_LVAL,
  1898.   Cvt_LVAL_to_XmRString};    /* sizeof(String) == sizeof(char*) */
  1899.  
  1900. /*
  1901.  * A version of Cvt_LVAL_to_XmRString() which copies the string... needed
  1902.  * because XmNgeometry is a fucked up resource in Motif 1.1.
  1903.  */
  1904. static XtArgVal Cvt_LVAL_to_XmRString_for_XmNgeometry(lisp_val, resource, o_widget)
  1905.      LVAL               lisp_val;
  1906.      Resource_Instance* resource;
  1907.      LVAL               o_widget;
  1908. {
  1909.   return ((XtArgVal) XtNewString((String) getstring(lisp_val)));
  1910. }
  1911.  
  1912. static Resource_Class resclass_XmRString_for_XmNgeometry = {
  1913.   XmRString,
  1914.   STRING,
  1915.   Cvt_XmRString_to_LVAL,
  1916.   Cvt_LVAL_to_XmRString_for_XmNgeometry}; /* sizeof(String) == sizeof(char*) */
  1917.  
  1918.  
  1919.  
  1920. /********************************************************************************/
  1921. static Resource_Enums XmRStringDirection_enums_alist[] = {
  1922.   {":STRING_DIRECTION_L_TO_R",    XmSTRING_DIRECTION_L_TO_R,    NULL},
  1923.   {":STRING_DIRECTION_R_TO_L",    XmSTRING_DIRECTION_R_TO_L,    NULL},
  1924.   {NULL, NULL, NULL}
  1925. };
  1926.  
  1927. static Resource_Class resclass_XmRStringDirection = {
  1928.   XmRStringDirection,    
  1929.   SYMBOL,            /* enumerated type */
  1930.   Cvt_XtEnum_to_LVAL, 
  1931.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  1932.   XmRStringDirection_enums_alist
  1933.   };
  1934.  
  1935.  
  1936.  
  1937. /********************************************************************************/
  1938. static LVAL Cvt_XmRStringTable_to_LVAL(res_val, resource)
  1939.      GetValues_Union    res_val;
  1940.      Resource_Instance* resource;
  1941. {
  1942.   /*
  1943.    * XmRStringTable resources XmNbuttonAccelerators and XmNbuttonMnemonicCharSets
  1944.    * is a create-time only resource. They cannot be retrieved via :GET_VALUES.
  1945.    * XmNargv could be read, but we need to access XmNargc to find out how long
  1946.    * it is. Therefore access XmNargv/XmNargc via method :GET_ARGV
  1947.    * on APPLICATION_SHELL_WIDGET_CLASS.
  1948.    */
  1949.   sprintf(temptext, "Cannot do :GET_VALUES on resource of type XmR%s.",
  1950.       resource->class->XmR_type);
  1951.   xlerror(temptext, resource->symbol);
  1952. }
  1953.  
  1954. #define STRINGTABLE_SIZE_INCREMENT 20
  1955. static XtArgVal Cvt_LVAL_to_XmRStringTable(lisp_val, resource, o_widget)
  1956.      LVAL               lisp_val;
  1957.      Resource_Instance* resource;
  1958.      LVAL               o_widget;
  1959. {
  1960.   int size, i;
  1961.   String* stringtable;
  1962.   LVAL elt;
  1963.  
  1964.   /*
  1965.    * if argument is a vector, then step through array of lisp <string>.
  1966.    */
  1967.   if (vectorp(lisp_val)) {
  1968.     size = getsize(lisp_val);
  1969.     stringtable = (String*) XtMalloc((unsigned) ((size + 1) * sizeof(String)));
  1970.  
  1971.     for (i = 0; i < size; i++) {
  1972.       elt = getelement(lisp_val, i);
  1973.       if (stringp(elt))
  1974.     stringtable[i] = (String) getstring(elt);
  1975.       else {
  1976.     XtFree(stringtable);
  1977.     sprintf(temptext,
  1978.         "Resource %s (type XmR%s) expects a sequence of STRINGs -- found a non STRING element in sequence.",
  1979.         resource->printname,
  1980.         resource->class->XmR_type);
  1981.     xlerror(temptext, elt);
  1982.       }
  1983.     }
  1984.     stringtable[i] = NULL;    /* null terminate */
  1985.     Wres_Free_This_Later((XtPointer) stringtable, XtFree); /* free stringtable after the resource is set. */
  1986.     return ((XtArgVal) stringtable);
  1987.   }
  1988.   /*
  1989.    * if argument is a list, then cdr through list of lisp <string>
  1990.    */
  1991.   else if (consp(lisp_val)) {
  1992.     size = STRINGTABLE_SIZE_INCREMENT;
  1993.     stringtable = (String*) XtMalloc((unsigned) ((size + 1) * sizeof(String)));
  1994.  
  1995.     for (i = 0 ; (consp(lisp_val)) ; lisp_val = cdr(lisp_val), i++) {
  1996.       if (i >= size) {        /* make sure it'll fit into allocated stringtable */
  1997.     size += STRINGTABLE_SIZE_INCREMENT;
  1998.     stringtable = (String*) XtRealloc(stringtable, (unsigned) ((size + 1) * sizeof(String)));
  1999.       }
  2000.       elt = car(lisp_val);
  2001.       if (stringp(elt))
  2002.     stringtable[i] = (String) getstring(elt);
  2003.       else {
  2004.     XtFree(stringtable);
  2005.     sprintf(temptext,
  2006.         "Resource %s (type XmR%s) expects a sequence of STRINGs -- found a non STRING element in sequence.",
  2007.         resource->printname,
  2008.         resource->class->XmR_type);
  2009.     xlerror(temptext, elt);
  2010.       }
  2011.     }
  2012.  
  2013.     if (lisp_val) {        /* if loop terminated due to list pointer not being a CONS cell */
  2014.       XtFree(stringtable);
  2015.       sprintf(temptext,
  2016.           "Resource %s (type XmR%s) expects a sequence of STRINGs -- a non STRING sequence was given.",
  2017.           resource->printname,
  2018.           resource->class->XmR_type);
  2019.       xlerror(temptext, lisp_val);
  2020.     }
  2021.  
  2022.     stringtable[i] = NULL;    /* null terminate */
  2023.     Wres_Free_This_Later((XtPointer) stringtable, XtFree); /* free stringtable after the resource is set. */
  2024.     return ((XtArgVal) stringtable);
  2025.   }
  2026.   /*
  2027.    * if argument wasn't list or vector, then error
  2028.    */
  2029.   else {
  2030.     sprintf(temptext,
  2031.         "Resource %s (type XmR%s) expects a sequence/list of STRINGs.",
  2032.         resource->printname,
  2033.         resource->class->XmR_type);
  2034.     xlerror(temptext, lisp_val);
  2035.   }
  2036. }
  2037.  
  2038. static Resource_Class resclass_XmRStringTable = {
  2039.   XmRStringTable,        /* note that this resource was declared as XmRPointer, but that's not specific enuf... */
  2040.   FREE,                /* can either be a vector or a list */
  2041.   Cvt_XmRStringTable_to_LVAL, 
  2042.   Cvt_LVAL_to_XmRStringTable};    /* sizeof(String*) */
  2043.  
  2044.  
  2045.  
  2046. /********************************************************************************/
  2047. #ifdef WINTERP_MOTIF_11
  2048. static LVAL Cvt_XmRTextPosition_to_LVAL(res_val, resource)
  2049.      GetValues_Union    res_val;
  2050.      Resource_Instance* resource;
  2051. {
  2052.   return (cvfixnum((FIXTYPE) res_val.XmTextPosition_value));
  2053. }
  2054.  
  2055. static XtArgVal Cvt_LVAL_to_XmRTextPosition(lisp_val, resource, o_widget)
  2056.      LVAL               lisp_val;
  2057.      Resource_Instance* resource;
  2058.      LVAL               o_widget;
  2059. {
  2060.   long value = (long) getfixnum(lisp_val); 
  2061.  
  2062.   /* XmTextPosition == long. Since FIXTYPE==long, there's no point
  2063.      in limiting the range. However, the first position in the text widget is 0, so we
  2064.      limit range to non-negative fixnums */
  2065.  
  2066.   Wres_Check_Value_Against_Minimum(value, 0L, resource, lisp_val);
  2067.  
  2068.   return ((XtArgVal) ((XmTextPosition) value));
  2069. }
  2070.  
  2071. static Resource_Class resclass_XmRTextPosition = {
  2072.   XmRTextPosition,    
  2073.   FIXNUM,            /* note that only non-negative FIXNUMS ok */
  2074.   Cvt_XmRTextPosition_to_LVAL, 
  2075.   Cvt_LVAL_to_XmRTextPosition};    /* sizeof(XmTextPosition) == sizeof(long) */
  2076.  
  2077. #endif                /* WINTERP_MOTIF_11 */
  2078.  
  2079.  
  2080.  
  2081. /********************************************************************************/
  2082. static LVAL Cvt_XmRTranslationTable_to_LVAL(res_val, resource)
  2083.      GetValues_Union    res_val;
  2084.      Resource_Instance* resource;
  2085. {
  2086.   return (cv_xttranslations((XtTranslations) res_val.XtPointer_value));
  2087. }
  2088.  
  2089. static XtArgVal Cvt_LVAL_to_XmRTranslationTable(lisp_val, resource, o_widget)
  2090.      LVAL               lisp_val;
  2091.      Resource_Instance* resource;
  2092.      LVAL               o_widget;
  2093. {
  2094.   return ((XtArgVal) get_xttranslations(lisp_val));
  2095. }
  2096.  
  2097. static Resource_Class resclass_XmRTranslationTable = {
  2098.   XmRTranslationTable,
  2099.   XLTYPE_XtTranslations,
  2100.   Cvt_XmRTranslationTable_to_LVAL,
  2101.   Cvt_LVAL_to_XmRTranslationTable}; /* sizeof(XtTranslations) */
  2102.  
  2103.  
  2104.  
  2105. /********************************************************************************/
  2106. static Resource_Enums XmRWhichButton_enums_alist[] = {
  2107.   {":BUTTON1",    Button1,    NULL},
  2108.   {":BUTTON2",    Button2,    NULL},
  2109.   {":BUTTON3",    Button3,    NULL},
  2110.   {":BUTTON4",    Button4,    NULL},
  2111.   {":BUTTON5",    Button5,    NULL},
  2112.   {NULL, NULL, NULL}
  2113. };
  2114.  
  2115. static Resource_Class resclass_XmRWhichButton = {
  2116.   XmRWhichButton,    
  2117.   SYMBOL,            /* enumerated type */
  2118.   Cvt_XtEnum_to_LVAL, 
  2119.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2120.   XmRWhichButton_enums_alist
  2121.   };
  2122.  
  2123.  
  2124.  
  2125. /********************************************************************************/
  2126. static LVAL Cvt_XmRWindow_to_LVAL(res_val, resource)
  2127.      GetValues_Union    res_val;
  2128.      Resource_Instance* resource;
  2129. {
  2130.   return (res_val.XtPointer_value ? cv_window((Window) res_val.XtPointer_value) : NIL);
  2131. }
  2132.  
  2133. static XtArgVal Cvt_LVAL_to_XmRWindow(lisp_val, resource, o_widget)
  2134.      LVAL               lisp_val;
  2135.      Resource_Instance* resource;
  2136.      LVAL               o_widget;
  2137. {
  2138.   return ((XtArgVal) get_window(lisp_val));
  2139. }
  2140.  
  2141. static Resource_Class resclass_XmRWindow = {
  2142.   XmRWindow,
  2143.   XLTYPE_Window,
  2144.   Cvt_XmRWindow_to_LVAL, 
  2145.   Cvt_LVAL_to_XmRWindow};    /* sizeof(Window) == sizeof(XID) == sizeof(unsigned long) */
  2146.  
  2147.  
  2148. /********************************************************************************/
  2149. #ifdef WINTERP_MOTIF_11
  2150. /*
  2151.  * Note -- resource XmNwinGravity is defined as XmRInt, but it is really an
  2152.  * enumerated type -- one of 10 different specifiers for "window gravity".
  2153.  * This is a fake representation type -- there really isn't a "XmRWindowGravity"
  2154.  */
  2155. static Resource_Enums XmRWindowGravity_enums_alist[] = {
  2156.   {":FORGET_GRAVITY",        ForgetGravity,        NULL},
  2157.   {":NORTH_WEST_GRAVITY",    NorthWestGravity,    NULL},
  2158.   {":NORTH_GRAVITY",        NorthGravity,        NULL},
  2159.   {":NORTH_EAST_GRAVITY",    NorthEastGravity,    NULL},
  2160.   {":WEST_GRAVITY",        WestGravity,        NULL},
  2161.   {":CENTER_GRAVITY",        CenterGravity,        NULL},
  2162.   {":EAST_GRAVITY",        EastGravity,        NULL},
  2163.   {":SOUTH_WEST_GRAVITY",    SouthWestGravity,    NULL},
  2164.   {":SOUTH_GRAVITY",        SouthGravity,        NULL},
  2165.   {":SOUTH_EAST_GRAVITY",    SouthEastGravity,    NULL},
  2166.   {":STATIC_GRAVITY",        StaticGravity,        NULL},
  2167.   {NULL, NULL, NULL}
  2168. };
  2169.  
  2170. static Resource_Class resclass_XmRWindowGravity = {
  2171.   "WindowGravity",    
  2172.   SYMBOL,            /* enumerated type */
  2173.   Cvt_Enum_Int_to_LVAL, 
  2174.   Cvt_LVAL_to_XtEnum,        /* sizeof(int) */
  2175.   XmRWindowGravity_enums_alist
  2176.   };
  2177. #endif                /* WINTERP_MOTIF_11 */
  2178.  
  2179.  
  2180.  
  2181. /********************************************************************************/
  2182. static LVAL Cvt_XmRWidget_to_LVAL(res_val, resource)
  2183.      GetValues_Union    res_val;
  2184.      Resource_Instance* resource;
  2185. {
  2186.   extern LVAL Wcls_WidgetID_To_WIDGETOBJ(); /* w_classes.c */
  2187.   return (Wcls_WidgetID_To_WIDGETOBJ((Widget) res_val.XtPointer_value));
  2188. }
  2189.  
  2190. static XtArgVal Cvt_LVAL_to_XmRWidget(lisp_val, resource, o_widget)
  2191.      LVAL lisp_val;        /* XLTYPE_WIDGETOBJ */
  2192.      Resource_Instance* resource;
  2193.      LVAL               o_widget;
  2194. {
  2195.   Widget widget_id;
  2196.   if (widget_id = get_widgetobj_widgetID(lisp_val))
  2197.     return ((XtArgVal) widget_id);
  2198.   else
  2199.     xlerror("WIDGETOBJ has been :destroy'd or hasn't been initialized by :isnew.", lisp_val);
  2200. }
  2201.  
  2202. static Resource_Class resclass_XmRWidget = {
  2203.   "Widget",            
  2204.   XLTYPE_WIDGETOBJ,
  2205.   Cvt_XmRWidget_to_LVAL,    /* cvt WidgetID back to widget object */
  2206.   Cvt_LVAL_to_XmRWidget};    /* cvt widget object to widget ID (sizeof(Widget))
  2207.                    make sure this has <widgetclass> in super */
  2208.  
  2209.  
  2210.  
  2211. /********************************************************************************/
  2212. static LVAL Cvt_XmRXmString_to_LVAL(res_val, resource)
  2213.      GetValues_Union    res_val;
  2214.      Resource_Instance* resource;
  2215. {
  2216. #ifdef WINTERP_MOTIF_11
  2217. #ifdef WINTERP_MOTIF_111    /* MOTIF 1.1.1 version */
  2218.   /*
  2219.    * Motif 1.1.1 documentation claims that XmStrings retrieved via XtGetValues()
  2220.    * are copies of the internal resource value, and that XmStringFree() must be
  2221.    * called by the application to free the copyied value. In WINTERP, by passing
  2222.    * the XmString pointer to cv_xmstring, we can be assured that the lisp-XmString
  2223.    * will get freed upon garbage collection when the node is no longer referenced.
  2224.    */
  2225.   return (res_val.XtPointer_value ? cv_xmstring((XmString) res_val.XtPointer_value) : NIL);
  2226. #else                /* MOTIF 1.1 version */
  2227.   /*
  2228.    * Motif 1.1's README states:
  2229.    * |        Compound String Resources Inconsistently Copied
  2230.    * | 
  2231.    * |        In this release, XtGetValues for a resource whose value is a
  2232.    * |        compound string sometimes does and sometimes does not copy
  2233.    * |        the returned string.  Following is a list of some known
  2234.    * |        resources whose XmString values are not copied (this list
  2235.    * |        may not be exhaustive):
  2236.    * | 
  2237.    * |             XmBulletinBoard     XmNdialogTitle
  2238.    * |             XmFileSelectionBox  XmNdirectory
  2239.    * |                                 XmNnoMatchString
  2240.    * |             XmRowColumn         XmNlabelString
  2241.    * |             XmScale             XmNtitleString
  2242.    *
  2243.    * Handling the above would require special casing for all XmRString resources,
  2244.    * which I don't have time to do. They fixed this stupidity in 1.1.1 (see above),
  2245.    * but certainly in a suboptimal fashion -- yet more wasteful copying occurs because
  2246.    * all widgets copy their internal XmStrings upon XtGetValues().
  2247.    *
  2248.    * The upshot of all this is that for Motif 1.1 (but not 1.1.1), there will be a memory
  2249.    * leak in XtGetValues() on XmString resources that copy the internal resource value.
  2250.    * We must make a copy here because it would be worse to XmStringFree() resources that
  2251.    * returned a pointer whose memory was managed by Motif.
  2252.    */
  2253.   return (res_val.XtPointer_value ? cv_xmstring(XmStringCopy((XmString) res_val.XtPointer_value)) : NIL);
  2254. #endif /* WINTERP_MOTIF_111 */
  2255. #else                /* MOTIF 1.0 version */
  2256.   /*
  2257.    * In Motif 1.0, XmStrings() returned via XtGetValues() were temporary pointers
  2258.    * that has to be copied via XmStringCopy()...
  2259.    */
  2260.   return (res_val.XtPointer_value ? cv_xmstring(XmStringCopy((XmString) res_val.XtPointer_value)) : NIL);
  2261. #endif /* WINTERP_MOTIF_11 */
  2262. }
  2263.  
  2264. static XtArgVal Cvt_LVAL_to_XmRXmString(lisp_val, resource, o_widget)
  2265.      LVAL               lisp_val;
  2266.      Resource_Instance* resource;
  2267.      LVAL               o_widget;
  2268. {
  2269.   /*
  2270.     Note that all XmString resources are copied into the Motif
  2271.     widget's space and thereafter managed by that widget. That
  2272.     means we don't need to worry about making an additional
  2273.     reference to the lisp XmString value that was passed in.
  2274.     When the lisp XmString is no longer referenced, it will
  2275.     be freed via garbage collection. 
  2276.   */
  2277.   return ((XtArgVal) get_xmstring(lisp_val));
  2278. }
  2279.  
  2280. static Resource_Class resclass_XmRXmString = {
  2281.   XmRXmString,
  2282.   XLTYPE_XmString,
  2283.   Cvt_XmRXmString_to_LVAL,
  2284.   Cvt_LVAL_to_XmRXmString};    /* sizeof(XmString) == sizeof(char*) */
  2285.  
  2286.  
  2287.  
  2288. /********************************************************************************/
  2289. static LVAL Cvt_XmRXmStringTable_to_LVAL(res_val, resource)
  2290.      GetValues_Union    res_val;
  2291.      Resource_Instance* resource;
  2292. {
  2293.   /*
  2294.     For doing XtGetValues(), we need to look at the size of the created
  2295.     XmStringTable divided by the sizeof(XmString), and use this value
  2296.     to return a vector of XmStrings... We need to make copies of these
  2297.     since it is just a pointer to internal data which is managed internally.
  2298.     Unfortunately, since we can't find out the size of the XmStringTable,
  2299.     nor are XmStringTable's null terminated, we cannot implement this
  2300.     converter. -- it must be implemented as a method on the appropriate
  2301.     widget class. 
  2302.     */
  2303.   sprintf(temptext,
  2304.       "Method :GET_VALUES not supported on resources of type XmR%s -- use method :GET_xxx_ITEMS method on appropriate widget class instead.",
  2305.       resource->class->XmR_type);
  2306.   xlerror(temptext, resource->symbol); 
  2307. }
  2308.  
  2309. /*
  2310.  * For XmStringTable XtSetValues(), or for widget args during creation, the fn
  2311.  * Cvt_LVAL_to_XmRXmStringTable will convert a vector/list of strings/XmStrings
  2312.  * into an XmStringTable,  which is an array of XmStrings. Both the array and
  2313.  * it's XmStrings are copied into the widget upon :setvalues/:new and are
  2314.  * managed by the widget afterwards. Therefore, all the XmStrings created
  2315.  * here are eventually freed by calling Wres_Free_C_Arglist_Data().
  2316.  */
  2317. static XtArgVal Cvt_LVAL_to_XmRXmStringTable(lisp_val, resource, o_widget)
  2318.      LVAL               lisp_val;
  2319.      Resource_Instance* resource;
  2320.      LVAL               o_widget;
  2321. {
  2322.   SuperXmStringTable superstrtab = Wxms_Cvt_LispStringSequence_to_SuperXmStringTable(lisp_val);
  2323.   Wres_Free_This_Later((XtPointer) superstrtab, Wxms_Free_SuperXmStringTable);
  2324.   return ((XtArgVal) superstrtab->xmstrtab);
  2325. }
  2326.  
  2327. static Resource_Class resclass_XmRXmStringTable = {
  2328.   XmRXmStringTable,    
  2329.   FREE,                /* can either be a vector or a list */
  2330.   Cvt_XmRXmStringTable_to_LVAL, 
  2331.   Cvt_LVAL_to_XmRXmStringTable}; /* sizeof(XmStringTable) == sizeof(XmString*) */
  2332.  
  2333.  
  2334.  
  2335. /********************************************************************************/
  2336. static Resource_Enums XmRUnitType_enums_alist[] = {
  2337.   {":PIXELS",        XmPIXELS,        NULL},
  2338.   {":100TH_MILLIMETERS",Xm100TH_MILLIMETERS,    NULL},
  2339.   {":1000TH_INCHES",    Xm1000TH_INCHES,    NULL},
  2340.   {":100TH_POINTS",    Xm100TH_POINTS,        NULL},
  2341.   {":100TH_FONT_UNITS",    Xm100TH_FONT_UNITS,    NULL},
  2342.   {NULL, NULL, NULL}
  2343. };
  2344.  
  2345. static Resource_Class resclass_XmRUnitType = {
  2346.   XmRUnitType,    
  2347.   SYMBOL,            /* enumerated type */
  2348.   Cvt_XtEnum_to_LVAL, 
  2349.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2350.   XmRUnitType_enums_alist
  2351.   };
  2352.  
  2353.  
  2354.  
  2355. /********************************************************************************/
  2356. static Resource_Enums XmRVisualPolicy_enums_alist[] = {
  2357.   {":VARIABLE",        XmVARIABLE,    NULL},
  2358.   {":CONSTANT",        XmCONSTANT,    NULL},
  2359.   {NULL, NULL, NULL}
  2360. };
  2361.  
  2362. static Resource_Class resclass_XmRVisualPolicy = {
  2363.   XmRVisualPolicy,    
  2364.   SYMBOL,            /* enumerated type */
  2365.   Cvt_XtEnum_to_LVAL, 
  2366.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2367.   XmRVisualPolicy_enums_alist
  2368.   };
  2369.  
  2370.  
  2371.  
  2372. /********************************************************************************/
  2373. /*
  2374.  * Note: in Xm/RowColumn.c, XmNentryClass/XmCEntryClass resource is coded
  2375.  * as being of representation type XmRInt, when it's value is supposed to hold
  2376.  * a widget class pointer. So we create a fake, new representation type
  2377.  * XmRWidgetClass for this resource.
  2378.  */
  2379. static LVAL Cvt_XmRWidgetClass_to_LVAL(res_val, resource)
  2380.      GetValues_Union    res_val;
  2381.      Resource_Instance* resource;
  2382. {
  2383.   extern LVAL Wcls_WidgetClassID_To_WIDGETCLASSOBJ(); /* w_classes.c */
  2384.   return (Wcls_WidgetClassID_To_WIDGETCLASSOBJ((WidgetClass) res_val.XtPointer_value));
  2385. }
  2386.  
  2387. static XtArgVal Cvt_LVAL_to_XmRWidgetClass(lisp_val, resource, o_widget)
  2388.      LVAL lisp_val;        /* OBJECT */
  2389.      Resource_Instance* resource;
  2390.      LVAL               o_widget;
  2391. {
  2392.   extern WidgetClass Wcls_WIDGETCLASSOBJ_To_WidgetClassID(); /* w_classes.c */
  2393.   WidgetClass result;
  2394.  
  2395.   if (xlclass_p(lisp_val) && !(result = Wcls_WIDGETCLASSOBJ_To_WidgetClassID(lisp_val))) {
  2396.     sprintf(temptext,
  2397.         "Resource %s (type XmR%s) expected a 'Class' object that is a subclass of 'WIDGET_CLASS'.",
  2398.         resource->printname,
  2399.         resource->class->XmR_type);
  2400.     xlerror(temptext, lisp_val);
  2401.   }
  2402.  
  2403.   return ((XtArgVal) result);
  2404. }
  2405.  
  2406. static Resource_Class resclass_XmRWidgetClass = {
  2407.   "WidgetClass",    
  2408.   OBJECT,            /* must be a widget class object */
  2409.   Cvt_XmRWidgetClass_to_LVAL, 
  2410.   Cvt_LVAL_to_XmRWidgetClass};    /* sizeof(WidgetClass) == sizeof(* struct _WidgetClassRec) */
  2411.  
  2412.  
  2413.  
  2414. /*----------------------------------------------------------------------------
  2415.  *-- RESOURCE CONVERTERS FOR THE HP GRAPH WIDGET (currently Motif 1.0 only) --
  2416.  *----------------------------------------------------------------------------*/
  2417. #ifdef HP_GRAPH_WIDGET
  2418.  
  2419. /********************************************************************************/
  2420. static Resource_Enums XmRArcDirection_enums_alist[] = {
  2421.   {":DIRECTED",        XmDIRECTED,        NULL},
  2422.   {":BIDIRECTED",    XmBIDIRECTED,        NULL},
  2423.   {":UNDIRECTED",    XmUNDIRECTED,        NULL},
  2424.   {NULL, NULL, NULL}
  2425. };
  2426.  
  2427. static Resource_Class resclass_XmRArcDirection = {
  2428.   XmRArcDirection,    
  2429.   SYMBOL,            /* enumerated type */
  2430.   Cvt_XtEnum_to_LVAL, 
  2431.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2432.   XmRArcDirection_enums_alist
  2433.   };
  2434.  
  2435.  
  2436.  
  2437. /********************************************************************************/
  2438. static Resource_Enums XmRLineStyle_enums_alist[] = {
  2439.   {":LINE_SOLID",        XmLineSolid,        NULL},
  2440.   {":LINE_ON_OFF_DASH",        XmLineOnOffDash,    NULL},
  2441.   {":LINE_DOUBLE_DASH",        XmLineDoubleDash,    NULL},
  2442.   {NULL, NULL, NULL}
  2443. };
  2444.  
  2445. static Resource_Class resclass_XmRLineStyle = {
  2446.   XmRLineStyle,    
  2447.   SYMBOL,            /* enumerated type */
  2448.   Cvt_XtEnum_to_LVAL, 
  2449.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2450.   XmRLineStyle_enums_alist
  2451.   };
  2452.  
  2453.  
  2454.  
  2455. /********************************************************************************/
  2456. static Resource_Enums XmRCapStyle_enums_alist[] = {
  2457.   {":CAP_NOT_LAST",    XmCapNotLast,        NULL},
  2458.   {":CAP_BUTT",        XmCapButt,        NULL},
  2459.   {":CAP_ROUND",    XmCapRound,        NULL},
  2460.   {":CAP_PROJECTING",    XmCapProjecting,    NULL},
  2461.   {NULL, NULL, NULL}
  2462. };
  2463.  
  2464. static Resource_Class resclass_XmRCapStyle = {
  2465.   XmRCapStyle,    
  2466.   SYMBOL,            /* enumerated type */
  2467.   Cvt_XtEnum_to_LVAL, 
  2468.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2469.   XmRCapStyle_enums_alist
  2470.   };
  2471.  
  2472.  
  2473.  
  2474. /********************************************************************************/
  2475. static Resource_Enums XmRArcDrawMode_enums_alist[] = {
  2476.   {":POSITION_FIXED",        XmPOSITION_FIXED,        NULL},
  2477.   {":POSITION_RELATIVE",    XmPOSITION_RELATIVE,        NULL},
  2478.   {NULL, NULL, NULL}
  2479. };
  2480.  
  2481. static Resource_Class resclass_XmRArcDrawMode = {
  2482.   XmRArcDrawMode,    
  2483.   SYMBOL,            /* enumerated type */
  2484.   Cvt_XtEnum_to_LVAL, 
  2485.   Cvt_LVAL_to_XtEnum,        /* sizeof(unsigned char) */
  2486.   XmRArcDrawMode_enums_alist
  2487.   };
  2488.  
  2489. #endif                /* HP_GRAPH_WIDGET */
  2490.  
  2491.  
  2492. /**************************************************************************/
  2493. /************     T A B L E     O F    R E S O U R C E S     **************/
  2494. /************                                                **************/
  2495. /**************************************************************************/
  2496. /*
  2497.  * each entry in table below is a triple of Resource_Instance structures:
  2498.  *     'char* printname'    'Resource_Class* class'        'char* name'
  2499.  * Note that 'LVAL symbol' part of Resource_Instance is set in Wres_Init().
  2500.  */
  2501. static Resource_Instance resource_table[] = {
  2502.   /*----------------------------------------------------------------------------
  2503.    *---------------------------- XmRAcceleratorTable ---------------------------
  2504.    *----------------------------------------------------------------------------*/
  2505.   {":XMN_TEXT_ACCELERATORS", &resclass_XmRAcceleratorTable, XmNtextAccelerators}, /* Xm/SelectionB.c */
  2506.   {":XMN_ACCELERATORS", &resclass_XmRAcceleratorTable, XmNaccelerators}, /* Xt/Core.c M1.1(Xm/BulletinB.c) */
  2507.   /*----------------------------------------------------------------------------
  2508.    *------------------------------- XmRAlignment -------------------------------
  2509.    *----------------------------------------------------------------------------*/
  2510.   {":XMN_ALIGNMENT", &resclass_XmRAlignment, XmNalignment}, /* Xm/Label.c Xm/LabelG.c */
  2511.   {":XMN_MESSAGE_ALIGNMENT", &resclass_XmRAlignment, XmNmessageAlignment}, /* Xm/MessageB.c */
  2512.   {":XMN_ENTRY_ALIGNMENT", &resclass_XmRAlignment, XmNentryAlignment}, /* Xm/RowColumn.c*/
  2513.   /*----------------------------------------------------------------------------
  2514.    *----------------------------  XmRArrowDirection  ---------------------------
  2515.    *----------------------------------------------------------------------------*/
  2516.   {":XMN_ARROW_DIRECTION", &resclass_XmRArrowDirection, XmNarrowDirection}, /* Xm/ArrowB.c Xm/ArrowBG.c */
  2517.   /*----------------------------------------------------------------------------
  2518.    *------------------------------ XmRAttachment  ------------------------------
  2519.    *----------------------------------------------------------------------------*/
  2520.   {":XMN_TOP_ATTACHMENT", &resclass_XmRAttachment, XmNtopAttachment}, /* Xm/Form.c */
  2521.   {":XMN_BOTTOM_ATTACHMENT", &resclass_XmRAttachment, XmNbottomAttachment}, /* Xm/Form.c */
  2522.   {":XMN_LEFT_ATTACHMENT", &resclass_XmRAttachment, XmNleftAttachment},    /* Xm/Form.c */
  2523.   {":XMN_RIGHT_ATTACHMENT", &resclass_XmRAttachment, XmNrightAttachment}, /* Xm/Form.c */
  2524.   /*----------------------------------------------------------------------------
  2525.    *--------------------------------- XmRBool ----------------------------------
  2526.    *----------------------------------------------------------------------------*/
  2527.   /*
  2528.    * Resource representation type XmRBool is essentially the same as boolean.
  2529.    * It is only used for the resource XmNinput.
  2530.    * Resource instances of type XmRBool unfortunately cannot be thrown into
  2531.    * resource class XmRBoolean because type Boolean=='unsigned char' while
  2532.    * type Bool=='int'. If XmRBool was treated as XmRBoolean, then doing :GET_VALUES
  2533.    * on such a resource would retrieve invalid values.
  2534.    *
  2535.    * This entire resource class should be thrown away if and when Motif and Xt get
  2536.    * some more consistently named/typed resources.
  2537.    */
  2538.   {":XMN_INPUT", &resclass_XmRBool, XmNinput}, /* Xm/Vendor.c Xt/Shell.c */
  2539.   /*----------------------------------------------------------------------------
  2540.    *---------------------------- XmRBooleanDimension ---------------------------
  2541.    *----------------------------------------------------------------------------*/
  2542.   /*
  2543.    * Resource representation type XmRBooleanDimension is essentially the same as
  2544.    * boolean. In Motif 1.1, it is only used for the resource XmNshowAsDefault.
  2545.    *
  2546.    * Resource instances of type XmRBooleanDimension unfortunately cannot be thrown
  2547.    * into resource class XmRBoolean because type Boolean=='unsigned char' while
  2548.    * XmRBooleanDimension is sizeof(Dimension)=='unsigned short'. If
  2549.    * XmRBooleanDimension was treated as XmRBoolean, then doing :GET_VALUES
  2550.    * on such a resource would retrieve invalid values.
  2551.    *
  2552.    * This entire resource class should be thrown away if and when Motif and Xt get
  2553.    * some more consistently named/typed resources.
  2554.    */
  2555. #ifdef WINTERP_MOTIF_11
  2556.   {":XMN_SHOW_AS_DEFAULT", &resclass_XmRBooleanDimension, XmNshowAsDefault}, /* Xm:PushB.c Xm:PushBG.c */
  2557. #else                /* MOTIF 1.0 */
  2558.   {":XMN_SHOW_AS_DEFAULT", &resclass_XmRShort, XmNshowAsDefault}, /* Xm:PushB.c Xm:PushBG.c */
  2559. #endif                /* WINTERP_MOTIF_11 */
  2560.   /*----------------------------------------------------------------------------
  2561.    *--------------------------------- XmRBoolean -------------------------------
  2562.    *----------------------------------------------------------------------------*/
  2563.   {":XMN_ALLOW_OVERLAP", &resclass_XmRBoolean, XmNallowOverlap}, /* Xm/BulletinB.c */
  2564.   {":XMN_AUTO_UNMANAGE", &resclass_XmRBoolean, XmNautoUnmanage}, /* Xm/BulletinB.c Xm/Command.c Xm/FileSB.c */
  2565.   {":XMN_DEFAULT_POSITION", &resclass_XmRBoolean, XmNdefaultPosition}, /* Xm/BulletinB.c Xm/Command.c */
  2566.   {":XMN_NO_RESIZE", &resclass_XmRBoolean, XmNnoResize}, /* Xm/BulletinB.c */
  2567.   {":XMN_TRAVERSAL_ON", &resclass_XmRBoolean, XmNtraversalOn}, /* M1.0(Xm/Gadget.c Xm/Primitive.c Xm/Scale.c) M1.1(Xm/CascadeB.c Xm/CascadeBG.c Xm/DrawnB.c Xm/Gadget.c Xm/Label.c Xm/LabelG.c Xm/Manager.c Xm/Primitive.c Xm/PushB.c Xm/PushBG.c Xm/ScrollBar.c Xm/SeparatoG.c Xm/Separator.c Xm/ToggleB.c Xm/ToggleBG.c) */
  2568.   {":XMN_PUSH_BUTTON_ENABLED", &resclass_XmRBoolean, XmNpushButtonEnabled}, /* Xm/DrawnB.c */
  2569.   {":XMN_LIST_UPDATED", &resclass_XmRBoolean, XmNlistUpdated}, /* Xm/FileSB.c */
  2570. #ifdef WINTERP_MOTIF_11
  2571.   {":XMN_DIRECTORY_VALID", &resclass_XmRBoolean, XmNdirectoryValid}, /* Xm/FileSB.c */
  2572. #endif                /* WINTERP_MOTIF_11 */
  2573.   {":XMN_RUBBER_POSITIONING", &resclass_XmRBoolean, XmNrubberPositioning}, /* Xm/Form.c */
  2574.   {":XMN_RESIZABLE", &resclass_XmRBoolean, XmNresizable}, /* Xm/Form.c */
  2575.   {":XMN_HIGHLIGHT_ON_ENTER", &resclass_XmRBoolean, XmNhighlightOnEnter}, /* Xm/Gadget.c Xm/Primitive.c Xm/Scale.c */
  2576.   {":XMN_RECOMPUTE_SIZE", &resclass_XmRBoolean, XmNrecomputeSize}, /* Xm/Label.c Xm/LabelG.c */
  2577.   {":XMN_AUTOMATIC_SELECTION", &resclass_XmRBoolean, XmNautomaticSelection}, /* Xm/List.c */
  2578.   {":XMN_SHOW_SEPARATOR", &resclass_XmRBoolean, XmNshowSeparator}, /* Xm/MainW.c */
  2579.   {":XMN_MINIMIZE_BUTTONS", &resclass_XmRBoolean, XmNminimizeButtons}, /* Xm/MessageB.c Xm/SelectionB.c */
  2580.   {":XMN_REFIGURE_MODE", &resclass_XmRBoolean, XmNrefigureMode}, /* Xm/PanedW.c */
  2581.   {":XMN_SEPARATOR_ON", &resclass_XmRBoolean, XmNseparatorOn}, /* Xm/PanedW.c */
  2582.   {":XMN_ALLOW_RESIZE", &resclass_XmRBoolean, XmNallowResize}, /* Xm/PanedW.c */
  2583.   {":XMN_SKIP_ADJUST", &resclass_XmRBoolean, XmNskipAdjust}, /* Xm/PanedW.c */
  2584.   {":XMN_FILL_ON_ARM", &resclass_XmRBoolean, XmNfillOnArm}, /* Xm/PushB.c & Xm/PushBG.c */
  2585.   {":XMN_RESIZE_WIDTH", &resclass_XmRBoolean, XmNresizeWidth}, /* Xm/RowColumn.c Xm/TextOut.c Xm/TextF.c: */
  2586.   {":XMN_RESIZE_HEIGHT", &resclass_XmRBoolean, XmNresizeHeight}, /* Xm/RowColumn.c Xm/TextOut.c */
  2587.   {":XMN_ADJUST_LAST", &resclass_XmRBoolean, XmNadjustLast}, /* Xm/RowColumn.c */
  2588.   {":XMN_ADJUST_MARGIN", &resclass_XmRBoolean, XmNadjustMargin}, /* Xm/RowColumn.c */
  2589.   {":XMN_RADIO_ALWAYS_ONE", &resclass_XmRBoolean, XmNradioAlwaysOne}, /* Xm/RowColumn.c */
  2590.   {":XMN_IS_HOMOGENEOUS", &resclass_XmRBoolean, XmNisHomogeneous}, /* Xm/RowColumn.c */
  2591.   {":XMN_POPUP_ENABLED", &resclass_XmRBoolean, XmNpopupEnabled}, /* Xm/RowColumn.c */
  2592.   {":XMN_RADIO_BEHAVIOR", &resclass_XmRBoolean, XmNradioBehavior}, /* Xm/RowColumn.c */
  2593.   {":XMN_IS_ALIGNED", &resclass_XmRBoolean, XmNisAligned}, /* Xm/RowColumn.c */
  2594.   {":XMN_SHOW_VALUE", &resclass_XmRBoolean, XmNshowValue}, /* Xm/Scale.c */
  2595.   {":XMN_SHOW_ARROWS", &resclass_XmRBoolean, XmNshowArrows}, /* Xm/ScrollBar.c */
  2596.   {":XMN_MUST_MATCH", &resclass_XmRBoolean, XmNmustMatch}, /* Xm/SelectionB.c */
  2597.   {":XMN_AUTO_SHOW_CURSOR_POSITION", &resclass_XmRBoolean, XmNautoShowCursorPosition}, /* Xm/Text.c */
  2598.   {":XMN_EDITABLE", &resclass_XmRBoolean, XmNeditable},    /* Xm/Text.c Xm/TextF.c XmGraph/Graph.c */
  2599.   {":XMN_CURSOR_POSITION_VISIBLE", &resclass_XmRBoolean, XmNcursorPositionVisible}, /* Xm/TextOut.c Xm/TextF.c */
  2600. #ifdef WINTERP_MOTIF_11
  2601.   {":XMN_VERIFY_BELL", &resclass_XmRBoolean, XmNverifyBell}, /* Xm/Text.c Xm/TextF.c */
  2602. #endif                /* WINTERP_MOTIF_11 */
  2603.   {":XMN_PENDING_DELETE", &resclass_XmRBoolean, XmNpendingDelete}, /* Xm/TextIn.c Xm/TextF.c */
  2604.   {":XMN_WORD_WRAP", &resclass_XmRBoolean, XmNwordWrap}, /* Xm/TextOut.c */
  2605.   {":XMN_SCROLL_VERTICAL", &resclass_XmRBoolean, XmNscrollVertical}, /* Xm/TextOut.c */
  2606.   {":XMN_SCROLL_HORIZONTAL", &resclass_XmRBoolean, XmNscrollHorizontal}, /* Xm/TextOut.c */
  2607.   {":XMN_SCROLL_LEFT_SIDE", &resclass_XmRBoolean, XmNscrollLeftSide}, /* Xm/TextOut.c */
  2608.   {":XMN_SCROLL_TOP_SIDE", &resclass_XmRBoolean, XmNscrollTopSide}, /* Xm/TextOut.c */
  2609.   {":XMN_VISIBLE_WHEN_OFF", &resclass_XmRBoolean, XmNvisibleWhenOff}, /* Xm/ToggleB.c Xm/ToggleBG.c */
  2610.   {":XMN_SET", &resclass_XmRBoolean, XmNset}, /* Xm/ToggleB.c Xm/ToggleBG.c */
  2611.   {":XMN_INDICATOR_ON", &resclass_XmRBoolean, XmNindicatorOn}, /* Xm/ToggleB.c Xm/ToggleBG.c */
  2612.   {":XMN_FILL_ON_SELECT", &resclass_XmRBoolean, XmNfillOnSelect}, /* Xm/ToggleB.c Xm/ToggleBG.c */
  2613. #ifdef WINTERP_MOTIF_11
  2614.   {":XMN_USE_ASYNC_GEOMETRY", &resclass_XmRBoolean, XmNuseAsyncGeometry}, /* Xm/VendorE.c */
  2615. #endif                /* WINTERP_MOTIF_11 */
  2616.   {":XMN_MAPPED_WHEN_MANAGED", &resclass_XmRBoolean, XmNmappedWhenManaged}, /* Xt/Core.c */
  2617.   {":XMN_ANCESTOR_SENSITIVE", &resclass_XmRBoolean, XmNancestorSensitive}, /* Xt/RectObj.c Xt/Shell.c */
  2618.   {":XMN_SENSITIVE", &resclass_XmRBoolean, XmNsensitive}, /* Xt/RectObj.c */
  2619.   {":XMN_ALLOW_SHELL_RESIZE", &resclass_XmRBoolean, XmNallowShellResize}, /* Xt/Shell.c */
  2620.   {":XMN_SAVE_UNDER", &resclass_XmRBoolean, XmNsaveUnder}, /* Xt/Shell.c */
  2621.   {":XMN_OVERRIDE_REDIRECT", &resclass_XmRBoolean, XmNoverrideRedirect}, /* Xt/Shell.c */
  2622.   {":XMN_WAIT_FOR_WM", &resclass_XmRBoolean, XmNwaitForWm}, /* Xt/Shell.c */
  2623.   {":XMN_TRANSIENT", &resclass_XmRBoolean, XmNtransient}, /* Xt/Shell.c */
  2624.   {":XMN_ICONIC", &resclass_XmRBoolean, XmNiconic}, /* Xt/Shell.c */
  2625. #ifdef WINTERP_MOTIF_11
  2626.   {":XMN_INITIAL_RESOURCES_PERSISTENT", &resclass_XmRBoolean, XmNinitialResourcesPersistent}, /* Xt/Resources.c */
  2627. #endif                /* WINTERP_MOTIF_11 */
  2628.   /*----------------------------------------------------------------------------
  2629.    *------------------------------  XmRButtonType  -----------------------------
  2630.    *----------------------------------------------------------------------------*/
  2631. #ifdef WINTERP_MOTIF_11
  2632.   {":XMN_BUTTON_TYPE", &resclass_XmRButtonTypeTable, XmNbuttonType}, /* Xm/Simple.c */
  2633. #endif                /* WINTERP_MOTIF_11 */
  2634.   /*----------------------------------------------------------------------------
  2635.    *-------------------------------  XmRCallback  ------------------------------
  2636.    *----------------------------------------------------------------------------*/
  2637.   {":XMN_ACTIVATE_CALLBACK", &resclass_XmRCallback, XmNactivateCallback}, /* Xm/ArrowB.c Xm/ArrowBG.c Xm/CascadeB.c Xm/CascadeBG.c Xm/DrawnB.c Xm/PushB.c Xm/PushBG.c Xm/Text.c Xm/TextF.c XmGraph:Arc.c */
  2638.   {":XMN_ARM_CALLBACK", &resclass_XmRCallback, XmNarmCallback},    /* Xm/ArrowB.c Xm/ArrowBG.c Xm/DrawnB.c Xm/PushB.c Xm/PushBG.c Xm/ToggleB.c Xm/ToggleBG.c XmGraph:Arc.c */
  2639.   {":XMN_DISARM_CALLBACK", &resclass_XmRCallback, XmNdisarmCallback}, /* Xm/ArrowB.c Xm/ArrowBG.c Xm/DrawnB.c Xm/PushB.c Xm/PushBG.c Xm/ToggleB.c Xm/ToggleBG.c XmGraph:Arc.c */
  2640.   {":XMN_FOCUS_CALLBACK", &resclass_XmRCallback, XmNfocusCallback}, /* Xm/BulletinB.c Xm/Text.c */
  2641.   {":XMN_LOSING_FOCUS_CALLBACK", &resclass_XmRCallback, XmNlosingFocusCallback}, /* Xm/BulletinB.c Xm/Text.c Xm/TextF.c */
  2642.   {":XMN_MAP_CALLBACK", &resclass_XmRCallback, XmNmapCallback},    /* Xm/BulletinB.c Xm/RowColumn.c */
  2643.   {":XMN_UNMAP_CALLBACK", &resclass_XmRCallback, XmNunmapCallback}, /* Xm/BulletinB.c Xm/RowColumn.c */
  2644.   {":XMN_CASCADING_CALLBACK", &resclass_XmRCallback, XmNcascadingCallback}, /* Xm/CascadeB.c Xm/CascadeBG.c */
  2645.   {":XMN_COMMAND_ENTERED_CALLBACK", &resclass_XmRCallback, XmNcommandEnteredCallback}, /* Xm/Command.c */
  2646.   {":XMN_COMMAND_CHANGED_CALLBACK", &resclass_XmRCallback, XmNcommandChangedCallback}, /* Xm/Command.c */
  2647.   {":XMN_RESIZE_CALLBACK", &resclass_XmRCallback, XmNresizeCallback}, /* Xm/DrawingA.c Xm/DrawnB.c */
  2648.   {":XMN_EXPOSE_CALLBACK", &resclass_XmRCallback, XmNexposeCallback}, /* Xm/DrawingA.c Xm/DrawnB.c */
  2649.   {":XMN_INPUT_CALLBACK", &resclass_XmRCallback, XmNinputCallback}, /* Xm/DrawingA.c */
  2650.   {":XMN_HELP_CALLBACK", &resclass_XmRCallback, XmNhelpCallback}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c */
  2651.   {":XMN_SINGLE_SELECTION_CALLBACK", &resclass_XmRCallback, XmNsingleSelectionCallback}, /* Xm/List.c */
  2652.   {":XMN_MULTIPLE_SELECTION_CALLBACK", &resclass_XmRCallback, XmNmultipleSelectionCallback}, /* Xm/List.c */
  2653.   {":XMN_EXTENDED_SELECTION_CALLBACK", &resclass_XmRCallback, XmNextendedSelectionCallback}, /* Xm/List.c */
  2654.   {":XMN_BROWSE_SELECTION_CALLBACK", &resclass_XmRCallback, XmNbrowseSelectionCallback}, /* Xm/List.c */
  2655.   {":XMN_DEFAULT_ACTION_CALLBACK", &resclass_XmRCallback, XmNdefaultActionCallback}, /* Xm/List.c */ 
  2656.   {":XMN_OK_CALLBACK", &resclass_XmRCallback, XmNokCallback}, /* Xm/MessageB.c Xm/SelectioB.c */
  2657.   {":XMN_CANCEL_CALLBACK", &resclass_XmRCallback, XmNcancelCallback}, /* Xm/MessageB.c Xm/SelectioB.c */
  2658.   {":XMN_ENTRY_CALLBACK", &resclass_XmRCallback, XmNentryCallback}, /* Xm/RowColumn.c */
  2659.   {":XMN_VALUE_CHANGED_CALLBACK", &resclass_XmRCallback, XmNvalueChangedCallback}, /* Xm/Scale.c Xm/ScrollBar.c Xm/Text.c Xm/TextF.c Xm/ToggleB.c Xm/ToggleBG.c */
  2660.   {":XMN_DRAG_CALLBACK", &resclass_XmRCallback, XmNdragCallback}, /* Xm/Scale.c Xm/ScrollBar.c */
  2661.   {":XMN_INCREMENT_CALLBACK", &resclass_XmRCallback, XmNincrementCallback}, /* Xm/ScrollBar.c */
  2662.   {":XMN_DECREMENT_CALLBACK", &resclass_XmRCallback, XmNdecrementCallback}, /* Xm/ScrollBar.c */
  2663.   {":XMN_PAGE_INCREMENT_CALLBACK", &resclass_XmRCallback, XmNpageIncrementCallback}, /* Xm/ScrollBar.c */
  2664.   {":XMN_PAGE_DECREMENT_CALLBACK", &resclass_XmRCallback, XmNpageDecrementCallback}, /* Xm/ScrollBar.c */
  2665.   {":XMN_TO_TOP_CALLBACK", &resclass_XmRCallback, XmNtoTopCallback}, /* Xm/ScrollBar.c */
  2666.   {":XMN_TO_BOTTOM_CALLBACK", &resclass_XmRCallback, XmNtoBottomCallback}, /* Xm/ScrollBar.c */
  2667.   {":XMN_NO_MATCH_CALLBACK", &resclass_XmRCallback, XmNnoMatchCallback}, /* Xm/SelectioB.c */
  2668.   {":XMN_APPLY_CALLBACK", &resclass_XmRCallback, XmNapplyCallback}, /* Xm/SelectioB.c */
  2669.   {":XMN_MODIFY_VERIFY_CALLBACK", &resclass_XmRCallback, XmNmodifyVerifyCallback}, /* Xm/Text.c Xm/TextF.c */
  2670.   {":XMN_MOTION_VERIFY_CALLBACK", &resclass_XmRCallback, XmNmotionVerifyCallback}, /* Xm/Text.c Xm/TextF.c */
  2671. #ifdef WINTERP_MOTIF_11
  2672.   {":XMN_GAIN_PRIMARY_CALLBACK", &resclass_XmRCallback, XmNgainPrimaryCallback}, /* Xm/Text.c Xm/TextF.c */
  2673.   {":XMN_LOSE_PRIMARY_CALLBACK", &resclass_XmRCallback, XmNlosePrimaryCallback}, /* Xm/Text.c Xm/TextF.c */
  2674.   {":XMN_FOCUS_MOVED_CALLBACK", &resclass_XmRCallback, XmNfocusMovedCallback}, /* Xm/VendorE.c */
  2675.   {":XMN_REALIZE_CALLBACK", &resclass_XmRCallback, XmNrealizeCallback},    /* Xm/VendorE.c */
  2676. #endif                /* WINTERP_MOTIF_11 */
  2677.   {":XMN_DESTROY_CALLBACK", &resclass_XmRCallback, XmNdestroyCallback},    /* Xt/Object.c */
  2678.   {":XMN_POPUP_CALLBACK", &resclass_XmRCallback, XmNpopupCallback}, /* Xt/Shell.c */
  2679.   {":XMN_POPDOWN_CALLBACK", &resclass_XmRCallback, XmNpopdownCallback},    /* Xt/Shell.c */
  2680.   /*----------------------------------------------------------------------------
  2681.    *------------------------- XmRCommandWindowLocation --------------------------
  2682.    *----------------------------------------------------------------------------*/
  2683. #ifdef WINTERP_MOTIF_11
  2684.   {":XMN_COMMAND_WINDOW_LOCATION", &resclass_XmRCommandWindowLocation, XmNcommandWindowLocation}, /* Xm/MainW.c */
  2685. #endif                /* WINTERP_MOTIF_11 */
  2686.   /*----------------------------------------------------------------------------
  2687.    *------------------------------- XmRKeySym ----------------------------------
  2688.    *----------------------------------------------------------------------------*/
  2689. #ifdef WINTERP_MOTIF_11
  2690.   {":XMN_MNEMONIC", &resclass_XmRKeySym, XmNmnemonic}, /* Xm/Label.c Xm/LabelG.c Xm/RowColumn.c */
  2691.   {":XMN_OPTION_MNEMONIC", &resclass_XmRKeySym, XmNoptionMnemonic}, /* Xm/Simple.c */
  2692. #else                /* MOTIF 1.0 */
  2693.   {":XMN_MNEMONIC", &resclass_XmRChar, XmNmnemonic}, /* Xm/Label.c Xm/LabelG.c Xm/RowColumn.c */
  2694. #endif                /* WINTERP_MOTIF_11 */
  2695.   /*----------------------------------------------------------------------------
  2696.    *---------------------------- XmRKeySymTable --------------------------------
  2697.    *----------------------------------------------------------------------------*/
  2698. #ifdef WINTERP_MOTIF_11
  2699.   {":XMN_BUTTON_MNEMONICS", &resclass_XmRKeySymTable, XmNbuttonMnemonics}, /* Xm/Simple.c */
  2700. #endif                /* WINTERP_MOTIF_11 */
  2701.   /*----------------------------------------------------------------------------
  2702.    *--------------------------- XmRHorizontalDimension -------------------------
  2703.    *----------------------------------------------------------------------------*/
  2704. #ifdef WINTERP_MOTIF_11
  2705.   /*
  2706.    * Note that Motif 1.1 inconsistently declares resource XmNspacing:
  2707.    *    XmRDimension -- Xm/ScrolledW.c
  2708.    *    XmRHorizontalDimension -- Xm/RowColumn.c Xm/ToggleB.c Xm/ToggleBG.c
  2709.    *    XmRVerticalDimension -- Xm/PanedW.c
  2710.    * As a compromise, I'm throwing all uses into XmRHorizontalDimension.
  2711.    */
  2712.   {":XMN_SPACING", &resclass_XmRHorizontalDimension, XmNspacing}, /* Xm/ScrolledW.c Xm/PanedW.c Xm/RowColumn.c Xm/ToggleB.c Xm/ToggleBG.c */
  2713.   /* 
  2714.    * In Motif 1.1, Xm/DrawnB.c and Xm/ScrolledW.c inconsistently declare XmNshadowThickness
  2715.    * as XmRDimension. Here, we throw these resources in with XmRHorizontalDimension
  2716.    * since all other uses of XmNshadowThickness are XmRHorizontalDimension.
  2717.    *
  2718.    * Note: above inconsistency fixed in Motif 1.1.1.
  2719.    */
  2720.   {":XMN_SHADOW_THICKNESS", &resclass_XmRHorizontalDimension, XmNshadowThickness}, /* Xm/DrawnB.c Xm/ScrolledW.c Xm/BulletinB.c Xm/CascadeB.c Xm/CascadeBG.c Xm/Gadget.c Xm/Label.c Xm/LabelG.c Xm/Manager.c Xm/Primitive.c Xm/PushB.c Xm/PushBG.c Xm/RowColumn.c */
  2721.   {":XMN_MARGIN_WIDTH", &resclass_XmRHorizontalDimension, XmNmarginWidth}, /* Xm/BulletinB.c Xm/DrawingA.c Xm/Form.c Xm/Frame.c Xm/Label.c Xm/LabelG.c Xm/PanedW.c Xm/RowColumn.c Xm/Text.c Xm/TextF.c */
  2722.   {":XMN_HIGHLIGHT_THICKNESS", &resclass_XmRHorizontalDimension, XmNhighlightThickness}, /* Xm/CascadeB.c Xm/CascadeBG.c Xm/DrawnB.c Xm/Gadget.c Xm/Label.c Xm/LabelG.c Xm/Primitive.c Xm/PushB.c Xm/PushBG.c Xm/Scale.c Xm/ScrollBar.c Xm/SeparatoG.c Xm/Separator.c Xm/ToggleB.c Xm/ToggleBG.c */
  2723.   {":XMN_HORIZONTAL_SPACING", &resclass_XmRHorizontalDimension, XmNhorizontalSpacing}, /* Xm:Form.c */
  2724.   /*
  2725.    * XmNwidth is declared as XmRHorizontalDimension, except in Xm/Vendor.c, where it's a XmRShellHorizDim
  2726.    * and in Xt/RectObj.c, declared as XtRDimension. We throw both of those cases in with this resource class
  2727.    * XmRHorizontalDimension.
  2728.    */
  2729.   {":XMN_WIDTH", &resclass_XmRHorizontalDimension, XmNwidth}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c Xm/Scale.c Xm/Vendor.c */
  2730.   /*
  2731.    * Note that resource XmNborderWidth is inconsistently declared as XmRDimension in Xm/Sash.c and Xt/RectObj.c,
  2732.    * and as XmRShellHorizDim in Xm/Vendor.c.
  2733.    * Here, we throw these resources in with XmRHorizontalDimension since all other uses of XmNborderWidth are
  2734.    * XmRHorizontalDimension
  2735.    */
  2736.   {":XMN_BORDER_WIDTH", &resclass_XmRHorizontalDimension, XmNborderWidth}, /* Xm/Gadget.c Xm/Sash.c Xt/RectObj.c Xm/Manager.c Xm/Primitive.c Xm/Vendor.c */
  2737.   {":XMN_MARGIN_LEFT", &resclass_XmRHorizontalDimension, XmNmarginLeft}, /* Xm/Label.c Xm/LabelG.c */
  2738.   {":XMN_MARGIN_RIGHT", &resclass_XmRHorizontalDimension, XmNmarginRight}, /* Xm/Label.c Xm/LabelG.c */
  2739.   {":XMN_LIST_MARGIN_WIDTH", &resclass_XmRHorizontalDimension, XmNlistMarginWidth}, /* Xm/List.c */
  2740.   {":XMN_MAIN_WINDOW_MARGIN_WIDTH", &resclass_XmRHorizontalDimension, XmNmainWindowMarginWidth}, /* Xm/MainW.c */
  2741.   {":XMN_SASH_WIDTH", &resclass_XmRHorizontalDimension, XmNsashWidth}, /* Xm/PanedW.c */
  2742.   {":XMN_SASH_SHADOW_THICKNESS", &resclass_XmRHorizontalDimension, XmNsashShadowThickness}, /* Xm/PanedW.c */
  2743.   {":XMN_DEFAULT_BUTTON_SHADOW_THICKNESS", &resclass_XmRHorizontalDimension, XmNdefaultButtonShadowThickness}, /* Xm/PushB.c Xm/PushBG.c */ /* a new resource for 1.1 */
  2744.   {":XMN_ENTRY_BORDER", &resclass_XmRHorizontalDimension, XmNentryBorder}, /* Xm/RowColumn.c */
  2745.   {":XMN_SCALE_WIDTH", &resclass_XmRHorizontalDimension, XmNscaleWidth}, /* Xm/Scale.c */
  2746.   {":XMN_SCROLLED_WINDOW_MARGIN_WIDTH", &resclass_XmRHorizontalDimension, XmNscrolledWindowMarginWidth}, /* Xm/ScrolledW.c */
  2747.   {":XMN_MARGIN", &resclass_XmRHorizontalDimension, XmNmargin},    /* Xm/SeparatoG.c Xm/Separator.c */
  2748. #else                /* MOTIF 1.0 */
  2749.   /*
  2750.    * Note potential BUG: in Motif 1.0 spapshot #11, XmNSpacing is declared as short
  2751.    * in ToggleB.c/ToggleBG.c; declared as Dimension (unsigned int) in 
  2752.    * RowColumn.c (listed as short in docs); and declared as int in PanedW.c and Xm/ScrolledW.c.
  2753.    * It seems like this might cause weird results to be retrieved if we're
  2754.    * retrieving a short as an unsigned int. Perhaps we should retrieve as a
  2755.    * short? In either case this is a bug in Motif. (Fixed in 1.1)
  2756.    */
  2757.   {":XMN_SPACING", &resclass_XmRDimension, XmNspacing},    /* Xm/PanedW.c Xm/RowColumn.c Xm/ToggleB.c Xm/ToggleBG.c */
  2758.   {":XMN_SHADOW_THICKNESS", &resclass_XmRShort, XmNshadowThickness}, /* Xm:BulletinB.c Xm:CascadeB.c Xm:CascadeBG.c Xm:DrawnB.c Xm:Gadget.c Xm:Label.c Xm:LabelG.c Xm:Manager.c Xm:Primitive.c Xm:PushB.c Xm:PushBG.c Xm:ScrolledW.c */
  2759.   /*
  2760.    * Note potential BUG: in Motif 1.0 spapshot #11, XmNmarginWidth is declared as
  2761.    * short in Xm/BulletinB.c Xm/DrawingA.c Xm/Frame.c Xm/Label.c Xm/LabelG.c
  2762.    * Xm/PanedW.c and Xm/Text.c, but declared as Dimension (unsigned int) for
  2763.    * RowColumn.c. I'm going with the majority here, but it'll make R/C buggy.
  2764.    * Use :XMN_RCMARGIN_WIDTH for workaround. (Fixed in 1.1)
  2765.    */
  2766.   {":XMN_MARGIN_WIDTH", &resclass_XmRShort, XmNmarginWidth}, /* Xm:BulletinB.c Xm:DrawingA.c Xm:Frame.c Xm:Label.c Xm:LabelG.c Xm:PanedW.c Xm:Text.c */
  2767.   {":XMN_HIGHLIGHT_THICKNESS", &resclass_XmRShort, XmNhighlightThickness}, /* Xm:Gadget.c Xm:Primitive.c Xm:Scale.c */
  2768.   {":XMN_HORIZONTAL_SPACING", &resclass_XmRInt, XmNhorizontalSpacing}, /* Xm:Form.c */
  2769.   {":XMN_WIDTH", &resclass_XmRDimension, XmNwidth}, /* Xt/RectObj.c */
  2770.   {":XMN_BORDER_WIDTH", &resclass_XmRDimension, XmNborderWidth}, /* Xt:RectObj.c Xm:Gadget.c Xm:Manager.c Xm:Primitive.c Xm:Sash.c */
  2771.   {":XMN_MARGIN_LEFT", &resclass_XmRShort, XmNmarginLeft}, /* Xm:Label.c Xm:LabelG.c */
  2772.   {":XMN_MARGIN_RIGHT", &resclass_XmRShort, XmNmarginRight}, /* Xm:Label.c Xm:LabelG.c */
  2773.   {":XMN_LIST_MARGIN_WIDTH", &resclass_XmRShort, XmNlistMarginWidth}, /* Xm:List.c */
  2774.   {":XMN_MAIN_WINDOW_MARGIN_WIDTH", &resclass_XmRShort, XmNmainWindowMarginWidth}, /* Xm:MainW.c */
  2775.   {":XMN_SASH_WIDTH", &resclass_XmRDimension, XmNsashWidth}, /* Xm:PanedW.c */
  2776.   {":XMN_SASH_SHADOW_THICKNESS", &resclass_XmRInt, XmNsashShadowThickness}, /* Xm:PanedW.c */
  2777.   {":XMN_ENTRY_BORDER", &resclass_XmRDimension, XmNentryBorder}, /* Xm:RowColumn.c */
  2778.   {":XMN_SCALE_WIDTH", &resclass_XmRDimension, XmNscaleWidth}, /* Xm:Scale.c */
  2779.   {":XMN_SCROLLED_WINDOW_MARGIN_WIDTH", &resclass_XmRShort, XmNscrolledWindowMarginWidth}, /* Xm:ScrolledW.c */
  2780.   {":XMN_MARGIN", &resclass_XmRShort, XmNmargin}, /* Xm:Separator.c Xm:SeparatoG.c */
  2781. #endif                /* WINTERP_MOTIF_11 */
  2782.   /*----------------------------------------------------------------------------
  2783.    *---------------------------- XmRVerticalDimension --------------------------
  2784.    *----------------------------------------------------------------------------*/
  2785. #ifdef WINTERP_MOTIF_11
  2786.   /*
  2787.    * XmNheight is defined as XmRShellVertDim in Xm/Vendor.c and XtRDimension in Xt/RectObj.c
  2788.    * Here, we throw those uses into XmRVerticalDimension.
  2789.    */
  2790.   {":XMN_HEIGHT", &resclass_XmRVerticalDimension, XmNheight}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c Xm/Scale.c Xm/Vendor.c Xt/RectObj.c */
  2791.   {":XMN_MARGIN_HEIGHT", &resclass_XmRVerticalDimension, XmNmarginHeight}, /* Xm/BulletinB.c Xm/DrawingA.c Xm/Form.c Xm/Frame.c Xm/Label.c Xm/LabelG.c Xm/PanedW.c Xm/RowColumn.c Xm/Text.c Xm/TextF.c */
  2792.   {":XMN_VERTICAL_SPACING", &resclass_XmRVerticalDimension, XmNverticalSpacing}, /* Xm/Form.c */
  2793.   {":XMN_MARGIN_TOP", &resclass_XmRVerticalDimension, XmNmarginTop}, /* Xm/Label.c Xm/LabelG.c */
  2794.   {":XMN_MARGIN_BOTTOM", &resclass_XmRVerticalDimension, XmNmarginBottom}, /* Xm/Label.c Xm/LabelG.c */
  2795.   {":XMN_LIST_SPACING", &resclass_XmRVerticalDimension, XmNlistSpacing}, /* Xm/List.c */
  2796.   {":XMN_LIST_MARGIN_HEIGHT", &resclass_XmRVerticalDimension, XmNlistMarginHeight}, /* Xm/List.c */
  2797.   {":XMN_MAIN_WINDOW_MARGIN_HEIGHT", &resclass_XmRVerticalDimension, XmNmainWindowMarginHeight}, /* Xm/MainW.c */
  2798.   {":XMN_SASH_HEIGHT", &resclass_XmRVerticalDimension, XmNsashHeight}, /* Xm/PanedW.c */
  2799.   {":XMN_PANE_MINIMUM", &resclass_XmRVerticalDimension, XmNpaneMinimum}, /* Xm/PanedW.c */ /* a new resource for 1.1 */
  2800.   {":XMN_PANE_MAXIMUM", &resclass_XmRVerticalDimension, XmNpaneMaximum}, /* Xm/PanedW.c */ /* a new resource for 1.1 */
  2801.   {":XMN_SCALE_HEIGHT", &resclass_XmRVerticalDimension, XmNscaleHeight}, /* Xm/Scale.c */
  2802.   {":XMN_SCROLLED_WINDOW_MARGIN_HEIGHT", &resclass_XmRVerticalDimension, XmNscrolledWindowMarginHeight}, /* Xm/ScrolledW.c */
  2803.   {":XMN_INDICATOR_SIZE", &resclass_XmRVerticalDimension, XmNindicatorSize}, /* Xm/ToggleB.c Xm/ToggleBG.c */ /* a new resource for 1.1 */
  2804. #else                /* MOTIF 1.0 */
  2805.   {":XMN_HEIGHT", &resclass_XmRDimension, XmNheight}, /* Xt:RectObj.c */
  2806.   /*
  2807.    * Note potential BUG: in Motif 1.0 spapshot #11, XmNmarginHeight is declared as
  2808.    * short in Xm/BulletinB.c Xm/DrawingA.c Xm/Frame.c XmLabel.c Xm/LabelG.c
  2809.    * Xm/PanedW.c and Xm/Text.c, but declared as Dimension (unsigned int) for
  2810.    * RowColumn.c. I'm going with the majority here, but it'll make R/C buggy.
  2811.    * For workaround, use :XMN_RCMARGIN_HEIGHT.
  2812.    */
  2813.   {":XMN_MARGIN_HEIGHT", &resclass_XmRShort, XmNmarginHeight}, /* Xm:BulletinB.c Xm:DrawingA.c Xm:Frame.c Xm:Label.c Xm:LabelG.c Xm:PanedW.c Xm:Text.c */
  2814.   {":XMN_VERTICAL_SPACING", &resclass_XmRInt, XmNverticalSpacing}, /* Xm:Form.c */
  2815.   {":XMN_MARGIN_TOP", &resclass_XmRShort, XmNmarginTop}, /* Xm:Label.c Xm:LabelG.c */
  2816.   {":XMN_MARGIN_BOTTOM", &resclass_XmRShort, XmNmarginBottom}, /* Xm:Label.c Xm:LabelG.c */
  2817.   {":XMN_LIST_SPACING", &resclass_XmRShort, XmNlistSpacing}, /* Xm:List.c */
  2818.   {":XMN_LIST_MARGIN_HEIGHT", &resclass_XmRShort, XmNlistMarginHeight},    /* Xm:List.c */
  2819.   {":XMN_MAIN_WINDOW_MARGIN_HEIGHT", &resclass_XmRShort, XmNmainWindowMarginHeight}, /* Xm:MainW.c */
  2820.   {":XMN_SASH_HEIGHT", &resclass_XmRDimension, XmNsashHeight}, /* Xm:PanedW.c */
  2821.   {":XMN_SCALE_HEIGHT", &resclass_XmRDimension, XmNscaleHeight}, /* Xm:Scale.c */
  2822.   {":XMN_SCROLLED_WINDOW_MARGIN_HEIGHT", &resclass_XmRShort, XmNscrolledWindowMarginHeight}, /* Xm:ScrolledW.c */
  2823.   /*
  2824.    * the following are aliases to XmNmarginWidgth and XmNmarginHeight
  2825.    * This is a workaround to a Motif 1.0 bug which inconsistently declares
  2826.    * these resources only for Xm/RowColumn.c. Not needed for Motif 1.1.
  2827.    */
  2828.   {":XMN_RCMARGIN_WIDTH", &resclass_XmRDimension, XmNmarginWidth}, /* Xm:RowColumn.c -- this is a special alias for r/c widget due to name conflict*/
  2829.   {":XMN_RCMARGIN_HEIGHT", &resclass_XmRDimension, XmNmarginHeight}, /* Xm:RowColumn.c -- this is a special alias for r/c widget due to name conflic*/
  2830. #endif                /* WINTERP_MOTIF_11 */
  2831.   /*----------------------------------------------------------------------------
  2832.    *--------------------------- XmRDefaultButtonType ---------------------------
  2833.    *----------------------------------------------------------------------------*/
  2834.   {":XMN_DEFAULT_BUTTON_TYPE", &resclass_XmRDefaultButtonType, XmNdefaultButtonType}, /* Xm/MessageB.c */
  2835.   /*----------------------------------------------------------------------------
  2836.    *------------------------------ XmRDeleteResponse ---------------------------
  2837.    *----------------------------------------------------------------------------*/
  2838.   {":XMN_DELETE_RESPONSE", &resclass_XmRDeleteResponse, XmNdeleteResponse}, /* Xm/DialogS.c Xm/VendorE.c */
  2839.   /*----------------------------------------------------------------------------
  2840.    *-------------------------------  XmRDialogStyle ----------------------------
  2841.    *----------------------------------------------------------------------------*/
  2842.   {":XMN_DIALOG_STYLE", &resclass_XmRDialogStyle, XmNdialogStyle}, /* Xm/BulletinB.c */
  2843.   /*----------------------------------------------------------------------------
  2844.    *------------------------------  XmRDialogType  -----------------------------
  2845.    *----------------------------------------------------------------------------*/
  2846.   {":XMN_DIALOG_TYPE", &resclass_XmRDialogType, XmNdialogType},    /* Xm/Command.c Xm/FileSB.c Xm/MessageB.c Xm/SelectioB.c */
  2847.   /*----------------------------------------------------------------------------
  2848.    *------------------------------- XmREditMode --------------------------------
  2849.    *----------------------------------------------------------------------------*/
  2850.   {":XMN_EDIT_MODE", &resclass_XmREditMode, XmNeditMode}, /* Xm/Text.c */
  2851.   /*----------------------------------------------------------------------------
  2852.    *------------------------------ XmRFileTypeMask -----------------------------
  2853.    *----------------------------------------------------------------------------*/
  2854. #ifdef WINTERP_MOTIF_11
  2855.   {":XMN_FILE_TYPE_MASK", &resclass_XmRFileTypeMask, XmNfileTypeMask}, /* Xm/FileSB.c */
  2856. #endif                /* WINTERP_MOTIF_11 */
  2857.   /*----------------------------------------------------------------------------
  2858.    *-------------------------------- XmRFontList -------------------------------
  2859.    *----------------------------------------------------------------------------*/
  2860.   {":XMN_BUTTON_FONT_LIST", &resclass_XmRFontList, XmNbuttonFontList}, /* Xm/BulletinB.c */
  2861.   {":XMN_LABEL_FONT_LIST", &resclass_XmRFontList, XmNlabelFontList}, /* Xm/BulletinB.c */
  2862.   {":XMN_TEXT_FONT_LIST", &resclass_XmRFontList, XmNtextFontList}, /* Xm/BulletinB.c */
  2863.   {":XMN_FONT_LIST", &resclass_XmRFontList, XmNfontList}, /* Xm/Label.c Xm/LabelG.c Xm/List.c Xm:Scale.c Xm/TextF.c Xm:TextOut.c */
  2864. #ifdef WINTERP_MOTIF_11
  2865.   {":XMN_DEFAULT_FONT_LIST", &resclass_XmRFontList, XmNdefaultFontList}, /* Xm/MenuShell.c Xm/VendorE.c */
  2866. #endif                /* WINTERP_MOTIF_11 */
  2867.   /*----------------------------------------------------------------------------
  2868.    *----------------------------   XmRIndicatorType  ---------------------------
  2869.    *----------------------------------------------------------------------------*/
  2870.   {":XMN_INDICATOR_TYPE", &resclass_XmRIndicatorType, XmNindicatorType}, /* Xm/ToggleB.c Xm/ToggleBG.c */
  2871.   /*----------------------------------------------------------------------------
  2872.    *------------------------------ XtRInitialState -----------------------------
  2873.    *----------------------------------------------------------------------------*/
  2874. #ifdef WINTERP_MOTIF_11
  2875.   {":XMN_INITIAL_STATE", &resclass_XtRInitialState, XmNinitialState}, /* Xt:Shell.c */
  2876. #else                /* MOTIF 1.0 */
  2877.   {":XMN_INITIAL_STATE", &resclass_XmRInt, XmNinitialState}, /* Xt:Shell.c */
  2878. #endif                /* WINTERP_MOTIF_11 */
  2879.   /*----------------------------------------------------------------------------
  2880.    *----------------------------   XmRHorizontalInt  ---------------------------
  2881.    *----------------------------------------------------------------------------*/
  2882. #ifdef WINTERP_MOTIF_11
  2883.   {":XMN_BASE_WIDTH", &resclass_XmRHorizontalInt, XmNbaseWidth}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */ /* New resource for Motif 1.1 */
  2884.   {":XMN_MIN_WIDTH", &resclass_XmRHorizontalInt, XmNminWidth}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2885.   {":XMN_MAX_WIDTH", &resclass_XmRHorizontalInt, XmNmaxWidth}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2886.   {":XMN_WIDTH_INC", &resclass_XmRHorizontalInt, XmNwidthInc}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2887.   {":XMN_MIN_ASPECT_X", &resclass_XmRHorizontalInt, XmNminAspectX}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2888.   {":XMN_MAX_ASPECT_X", &resclass_XmRHorizontalInt, XmNmaxAspectX}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2889.   {":XMN_ICON_X", &resclass_XmRHorizontalInt, XmNiconX}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2890. #else                /* MOTIF 1.0 */
  2891.   {":XMN_MIN_WIDTH", &resclass_XmRInt, XmNminWidth}, /* Xt:Shell.c */
  2892.   {":XMN_MAX_WIDTH", &resclass_XmRInt, XmNmaxWidth}, /* Xt:Shell.c */
  2893.   {":XMN_WIDTH_INC", &resclass_XmRInt, XmNwidthInc}, /* Xt:Shell.c */
  2894.   {":XMN_MIN_ASPECT_X", &resclass_XmRInt, XmNminAspectX}, /* Xt:Shell.c */
  2895.   {":XMN_MAX_ASPECT_X", &resclass_XmRInt, XmNmaxAspectX}, /* Xt:Shell.c */
  2896.   {":XMN_ICON_X", &resclass_XmRInt, XmNiconX}, /* Xt:Shell.c */
  2897. #endif                /* WINTERP_MOTIF_11 */
  2898.   /*----------------------------------------------------------------------------
  2899.    *----------------------------        XmRInt       ---------------------------
  2900.    *----------------------------------------------------------------------------*/
  2901.   {":XMN_MAPPING_DELAY", &resclass_XmRInt, XmNmappingDelay}, /* Xm/CascadeB.c Xm/CascadeBG.c */
  2902.   {":XMN_HISTORY_ITEM_COUNT", &resclass_XmRInt, XmNhistoryItemCount}, /* Xm/Command.c */
  2903.   {":XMN_HISTORY_MAX_ITEMS", &resclass_XmRInt, XmNhistoryMaxItems}, /* Xm/Command.c */
  2904.   {":XMN_HISTORY_VISIBLE_ITEM_COUNT", &resclass_XmRInt, XmNhistoryVisibleItemCount}, /* Xm:Command.c */
  2905. #ifdef WINTERP_MOTIF_11
  2906.   {":XMN_DIR_LIST_ITEM_COUNT", &resclass_XmRInt, XmNdirListItemCount}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  2907.   {":XMN_FILE_LIST_ITEM_COUNT", &resclass_XmRInt, XmNfileListItemCount}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  2908. #endif                /* WINTERP_MOTIF_11 */
  2909.   {":XMN_FRACTION_BASE", &resclass_XmRInt, XmNfractionBase}, /* Xm/Form.c */
  2910.   {":XMN_TOP_POSITION", &resclass_XmRInt, XmNtopPosition}, /* Xm/Form.c (constraint res) [Xm:Text.c in Motif 1.0 only] */
  2911.   {":XMN_BOTTOM_POSITION", &resclass_XmRInt, XmNbottomPosition}, /* Xm/Form.c (constraint res) */
  2912.   {":XMN_LEFT_POSITION", &resclass_XmRInt, XmNleftPosition}, /* Xm/Form.c (constraint res) */
  2913.   {":XMN_RIGHT_POSITION", &resclass_XmRInt, XmNrightPosition}, /* Xm/Form.c (constraint res) */
  2914.   {":XMN_TOP_OFFSET", &resclass_XmRInt, XmNtopOffset}, /* Xm:Form.c (constraint res) */
  2915.   {":XMN_BOTTOM_OFFSET", &resclass_XmRInt, XmNbottomOffset}, /* Xm:Form.c (constraint res) */
  2916.   {":XMN_LEFT_OFFSET", &resclass_XmRInt, XmNleftOffset}, /* Xm:Form.c (constraint res) */
  2917.   {":XMN_RIGHT_OFFSET", &resclass_XmRInt, XmNrightOffset}, /* Xm:Form.c (constraint res) */
  2918.   {":XMN_ITEM_COUNT", &resclass_XmRInt, XmNitemCount}, /* Xm:List.c */
  2919.   {":XMN_SELECTED_ITEM_COUNT", &resclass_XmRInt, XmNselectedItemCount},    /* Xm:List.c */
  2920.   {":XMN_VISIBLE_ITEM_COUNT", &resclass_XmRInt, XmNvisibleItemCount}, /* Xm:List.c */
  2921. #ifdef WINTERP_MOTIF_11
  2922.   {":XMN_TOP_ITEM_POSITION", &resclass_XmRInt, XmNtopItemPosition}, /* Xm/List.c */ /* a new resource for MOTIF 1.1 */
  2923. #endif                /* WINTERP_MOTIF_11 */
  2924.   {":XMN_DOUBLE_CLICK_INTERVAL", &resclass_XmRInt, XmNdoubleClickInterval}, /* Xm/List.c XmGraph/Graph.c */
  2925. #ifdef WINTERP_MOTIF_11
  2926.   {":XMN_POST_FROM_COUNT", &resclass_XmRInt, XmNpostFromCount},    /* Xm/RowColumn.c */ /* a new resource for MOTIF 1.1 */
  2927. #endif                /* WINTERP_MOTIF_11 */
  2928.   {":XMN_VALUE", &resclass_XmRInt, XmNvalue}, /* Xm/Scale.c Xm/ScrollBar.c */
  2929.   {":XMN_MAXIMUM", &resclass_XmRInt, XmNmaximum}, /* Xm/Scale.c Xm/ScrollBar.c [Xm:PanedW.c in Motif 1.0 only] */
  2930.   {":XMN_MINIMUM", &resclass_XmRInt, XmNminimum}, /* Xm/Scale.c Xm/ScrollBar.c [Xm:PanedW.c in Motif 1.0 only] */
  2931. #ifdef WINTERP_MOTIF_11
  2932.   {":XMN_SCALE_MULTIPLE", &resclass_XmRInt, XmNscaleMultiple}, /* Xm/Scale.c */ /* a new resource for MOTIF 1.1 */
  2933. #endif                /* WINTERP_MOTIF_11 */
  2934.   {":XMN_SLIDER_SIZE", &resclass_XmRInt, XmNsliderSize}, /* Xm:ScrollBar.c */
  2935.   {":XMN_INCREMENT", &resclass_XmRInt, XmNincrement}, /* Xm:ScrollBar.c */
  2936.   {":XMN_PAGE_INCREMENT", &resclass_XmRInt, XmNpageIncrement}, /* Xm:ScrollBar.c */
  2937.   {":XMN_INITIAL_DELAY", &resclass_XmRInt, XmNinitialDelay}, /* Xm:ScrollBar.c */
  2938.   {":XMN_REPEAT_DELAY", &resclass_XmRInt, XmNrepeatDelay}, /* Xm:ScrollBar.c */
  2939.   {":XMN_LIST_ITEM_COUNT", &resclass_XmRInt, XmNlistItemCount},    /* Xm:SelectionB.c */
  2940.   {":XMN_LIST_VISIBLE_ITEM_COUNT", &resclass_XmRInt, XmNlistVisibleItemCount}, /* Xm:SelectionB.c */
  2941. #ifdef WINTERP_MOTIF_11
  2942.   {":XMN_BUTTON_COUNT", &resclass_XmRInt, XmNbuttonCount}, /* Xm/Simple.c */ /* a new resource for MOTIF 1.1 */
  2943.   {":XMN_POST_FROM_BUTTON", &resclass_XmRInt, XmNpostFromButton}, /* Xm/Simple.c */ /* a new resource for MOTIF 1.1 */
  2944.   {":XMN_BUTTON_SET", &resclass_XmRInt, XmNbuttonSet}, /* Xm/Simple.c */ /* a new resource for MOTIF 1.1 */
  2945. #endif                /* WINTERP_MOTIF_11 */
  2946.   {":XMN_MAX_LENGTH", &resclass_XmRInt, XmNmaxLength}, /* Xm:Text.c Xm/TextF.c */
  2947.   {":XMN_BLINK_RATE", &resclass_XmRInt, XmNblinkRate}, /* Xm/TextF.c Xm/TextOut.c */
  2948.   {":XMN_SELECTION_ARRAY_COUNT", &resclass_XmRInt, XmNselectionArrayCount}, /* Xm/TextF.c Xm/TextIn.c */
  2949.   {":XMN_SELECT_THRESHOLD", &resclass_XmRInt, XmNselectThreshold}, /* Xm/TextF.c Xm/TextIn.c */
  2950.   {":XMN_MWM_DECORATIONS", &resclass_XmRInt, XmNmwmDecorations}, /* Xm/VendorE.c */ /* value should be logior of MWM_DECOR_ALL MWM_DECOR_BORDER MWM_DECOR_RESIZEH MWM_DECOR_TITLE MWM_DECOR_MENU MWM_DECOR_MINIMIZE MWM_DECOR_MAXIMIZE */
  2951.   {":XMN_MWM_FUNCTIONS", &resclass_XmRInt, XmNmwmFunctions}, /* Xm/VendorE.c */ /* value should be logior of MWM_FUNC_ALL MWM_FUNC_RESIZE MWM_FUNC_MOVE MWM_FUNC_MINIMIZE MWM_FUNC_MAXIMIZE MWM_FUNC_CLOSE */
  2952.   {":XMN_MWM_INPUT_MODE", &resclass_XmRInt, XmNmwmInputMode}, /* Xm/VendorE.c */ /* value should be logior of MWM_INPUT_MODELESS MWM_INPUT_PRIMARY_APPLICATION_MODAL MWM_INPUT_SYSTEM_MODAL MWM_INPUT_FULL_APPLICATION_MODAL */
  2953.   {":XMN_DEPTH", &resclass_XmRInt, XmNdepth}, /* Xt/Core.c Xt/Shell.c */
  2954.   {":XMN_WM_TIMEOUT", &resclass_XmRInt, XmNwmTimeout}, /* Xt/Shell.c */
  2955. #ifdef THE_FOLLOWING_CODE_IS_COMMENTED_OUT
  2956.   {":XMN_ARGC", &resclass_XmRInt, XmNargc}, /* Xt/Shell.c (application shell only) */
  2957. #endif                /* THE_FOLLOWING_CODE_IS_COMMENTED_OUT */
  2958.   /*----------------------------------------------------------------------------
  2959.    *----------------------------    XmRVerticalInt   ---------------------------
  2960.    *----------------------------------------------------------------------------*/
  2961. #ifdef WINTERP_MOTIF_11
  2962.   {":XMN_BASE_HEIGHT", &resclass_XmRVerticalInt, XmNbaseHeight}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */ /* New resource for Motif 1.1 */
  2963.   {":XMN_MIN_HEIGHT", &resclass_XmRVerticalInt, XmNminHeight}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2964.   {":XMN_MAX_HEIGHT", &resclass_XmRVerticalInt, XmNmaxHeight}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2965.   {":XMN_HEIGHT_INC", &resclass_XmRVerticalInt, XmNheightInc}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2966.   {":XMN_MIN_ASPECT_Y", &resclass_XmRVerticalInt, XmNminAspectY}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2967.   {":XMN_MAX_ASPECT_Y", &resclass_XmRVerticalInt, XmNmaxAspectY}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2968.   {":XMN_ICON_Y", &resclass_XmRVerticalInt, XmNiconY}, /* Xm/Vendor.c Xt/Shell.c (as XmRInt) */
  2969. #else                /* MOTIF 1.0 */
  2970.   {":XMN_MIN_HEIGHT", &resclass_XmRInt, XmNminHeight}, /* Xt:Shell.c */
  2971.   {":XMN_MAX_HEIGHT", &resclass_XmRInt, XmNmaxHeight}, /* Xt:Shell.c */
  2972.   {":XMN_HEIGHT_INC", &resclass_XmRInt, XmNheightInc}, /* Xt:Shell.c */
  2973.   {":XMN_MIN_ASPECT_Y", &resclass_XmRInt, XmNminAspectY}, /* Xt:Shell.c */
  2974.   {":XMN_MAX_ASPECT_Y", &resclass_XmRInt, XmNmaxAspectY}, /* Xt:Shell.c */
  2975.   {":XMN_ICON_Y", &resclass_XmRInt, XmNiconY}, /* Xt:Shell.c */
  2976. #endif                /* WINTERP_MOTIF_11 */
  2977.   /*----------------------------------------------------------------------------
  2978.    *-------------------------- XmRKeyboardFocusPolicy --------------------------
  2979.    *----------------------------------------------------------------------------*/
  2980.   {":XMN_KEYBOARD_FOCUS_POLICY", &resclass_XmRKeyboardFocusPolicy, XmNkeyboardFocusPolicy}, /* Xm/VendorE.c */
  2981.   /*----------------------------------------------------------------------------
  2982.    *-------------------------------- XmRLabelType ------------------------------
  2983.    *----------------------------------------------------------------------------*/
  2984.   {":XMN_LABEL_TYPE", &resclass_XmRLabelType, XmNlabelType}, /* Xm/Label.c Xm/LabelG.c */
  2985.   /*----------------------------------------------------------------------------
  2986.    *----------------------------  XmRListSizePolicy  ---------------------------
  2987.    *----------------------------------------------------------------------------*/
  2988.   {":XMN_LIST_SIZE_POLICY", &resclass_XmRListSizePolicy, XmNlistSizePolicy}, /* Xm/List.c */
  2989.   /*----------------------------------------------------------------------------
  2990.    *------------------------------- XmRMultiClick ------------------------------
  2991.    *----------------------------------------------------------------------------*/
  2992. #ifdef WINTERP_MOTIF_11
  2993.   {":XMN_MULTI_CLICK", &resclass_XmRMultiClick, XmNmultiClick}, /* Xm/ArrowB.c Xm/ArrowBG.c Xm/DrawnB.c Xm/PushB.c Xm/PushBG.c */
  2994. #endif                /* WINTERP_MOTIF_11 */
  2995.   /*----------------------------------------------------------------------------
  2996.    *----------------------------- XmRNavigationType ----------------------------
  2997.    *----------------------------------------------------------------------------*/
  2998. #ifdef WINTERP_MOTIF_11
  2999.   {":XMN_NAVIGATION_TYPE", &resclass_XmRNavigationType, XmNnavigationType}, /* Xm/Gadget.c Xm/List.c Xm/MainW.c Xm/Manager.c Xm/Primitive.c Xm/RowColumn.c Xm/ScrollBar.c Xm/Text.c Xm/TextF.c */
  3000. #endif                /* WINTERP_MOTIF_11 */
  3001.   /*----------------------------------------------------------------------------
  3002.    *------------------------------- XmROrientation -----------------------------
  3003.    *----------------------------------------------------------------------------*/
  3004.   {":XMN_ORIENTATION", &resclass_XmROrientation, XmNorientation}, /* Xm/RowColumn.c Xm/Scale.c Xm/ScrollBar.c Xm/SeparatoG.c Xm/Separator.c XmGraph/Graph.c */
  3005.   /*----------------------------------------------------------------------------
  3006.    *------------------------------- XmRPacking ---------------------------------
  3007.    *----------------------------------------------------------------------------*/
  3008.   {":XMN_PACKING", &resclass_XmRPacking, XmNpacking}, /* Xm/RowColumn.c */
  3009.   /*----------------------------------------------------------------------------
  3010.    *---------------------------------- XmRPixel --------------------------------
  3011.    *----------------------------------------------------------------------------*/
  3012.   {":XMN_FOREGROUND", &resclass_XmRPixel, XmNforeground}, /* Xm/Manager.c Xm/Primitive.c Xm/ScrollBar.c XmGraph:Arc.c */
  3013.   {":XMN_BACKGROUND", &resclass_XmRPixel, XmNbackground}, /* Xm/Manager.c Xm:Primitive.c Xt/Core.c */
  3014.   {":XMN_HIGHLIGHT_COLOR", &resclass_XmRPixel, XmNhighlightColor}, /* Xm/Manager.c Xm/Primitive.c XmGraph:Arc.c */
  3015.   {":XMN_TOP_SHADOW_COLOR", &resclass_XmRPixel, XmNtopShadowColor}, /* Xm/Manager.c Xm/Primitive.c */
  3016.   {":XMN_BOTTOM_SHADOW_COLOR", &resclass_XmRPixel, XmNbottomShadowColor}, /* Xm/Manager.c Xm/Primitive.c */
  3017.   {":XMN_ARM_COLOR", &resclass_XmRPixel, XmNarmColor}, /* Xm/PushB.c Xm/PushBG.c */
  3018. #ifdef WINTERP_MOTIF_11
  3019.   {":XMN_TROUGH_COLOR", &resclass_XmRPixel, XmNtroughColor}, /* Xm/ScrollBar.c */ /* a new resource for MOTIF 1.1 */
  3020. #endif                /* WINTERP_MOTIF_11 */
  3021.   {":XMN_SELECT_COLOR", &resclass_XmRPixel, XmNselectColor}, /* Xm/ToggleB.c Xm/ToggleBG.c */  
  3022.   {":XMN_BORDER_COLOR", &resclass_XmRPixel, XmNborderColor}, /* Xt/Core.c */
  3023.   /*----------------------------------------------------------------------------
  3024.    *----------------------------------  "Pixmap"  ------------------------------
  3025.    *----------------------------------------------------------------------------*/
  3026.   /*
  3027.    * _XmRXmBackgroundPixmap -- note that this resource rep type has a very weird
  3028.    * side-effect-causing kludge-of-a-converter in Motif 1.1. It would seem this
  3029.    * converter needs to be used (by calling XtConvert(), rather than doing the
  3030.    * conversion ourselves in Wres_Get_LispArglist(). <Insert gestalt of puking
  3031.    * synaesthesia here>
  3032.    */
  3033. #ifdef WINTERP_MOTIF_11
  3034.   {":XMN_BACKGROUND_PIXMAP", &resclass_XmRXmBackgroundPixmap, XmNbackgroundPixmap},    /* /Xt/Core.c -- XmRPixmap; Xm/Manager.c Xm/Primitive.c -- XmRXmBackgroundPixmap */
  3035. #else
  3036.   {":XMN_BACKGROUND_PIXMAP", &resclass_XmRPixmap, XmNbackgroundPixmap},    /* Xt/Core.c Xm/Manager.c Xm/Primitive.c -- XmRPixmap */
  3037. #endif                /* WINTERP_MOTIF_11 */
  3038.   /*
  3039.    * "ForegroundPixmap" == XmRManForegroundPixmap + XmRPrimForegroundPixmap + XmRGadgetPixmap
  3040.    */
  3041.   {":XMN_SYMBOL_PIXMAP", &resclass_ForegroundPixmap, XmNsymbolPixmap}, /* in Xm/MessageB.c -- XmRManForegroundPixmap */
  3042.   {":XMN_CASCADE_PIXMAP", &resclass_ForegroundPixmap, XmNcascadePixmap}, /* Xm/CascadeB.c -- XmRPrimForegroundPixmap; Xm/CascadeBG.c -- XmRGadgetPixmap */
  3043.   {":XMN_LABEL_PIXMAP", &resclass_ForegroundPixmap, XmNlabelPixmap}, /* Xm/Label.c -- XmRPrimForegroundPixmap; Xm/LabelG.c -- XmRGadgetPixmap  */
  3044.   {":XMN_LABEL_INSENSITIVE_PIXMAP", &resclass_ForegroundPixmap, XmNlabelInsensitivePixmap}, /* Xm/Label.c -- XmRPixmap Xm:LabelG.c -- XmRGadgetPixmap */
  3045.   {":XMN_ARM_PIXMAP", &resclass_ForegroundPixmap, XmNarmPixmap}, /* in Xm/PushB.c -- XmRPrimForegroundPixmap; Xm/PushBG.c -- XmRGadgetPixmap */
  3046.   {":XMN_SELECT_PIXMAP", &resclass_ForegroundPixmap, XmNselectPixmap}, /* Xm/ToggleB.c -- XmRPrimForegroundPixmap; Xm/ToggleBG.c -- XmRGadgetPixmap */
  3047.   {":XMN_SELECT_INSENSITIVE_PIXMAP", &resclass_ForegroundPixmap, XmNselectInsensitivePixmap}, /* Xm/ToggleB.c -- XmRPixmap; Xm/ToggleBG.c -- XmRGadgetPixmap */
  3048.   {":XMN_ICON_PIXMAP", &resclass_ForegroundPixmap, XmNiconPixmap}, /* Xm/Vendor.c -- XmRPixmap; Xt/Shell.c (in Motif1.1 decld as XtRBitmap which is a pixmap of depth 1) */
  3049.   {":XMN_ICON_MASK", &resclass_ForegroundPixmap, XmNiconMask},    /* Xt/Shell.c  (in Motif1.1 decld as XtRBitmap which is a pixmap of depth 1) */
  3050.   {":XMN_BORDER_PIXMAP", &resclass_ForegroundPixmap, XmNborderPixmap},    /* Xt/Core.c -- XmRPixmap */
  3051.   /*
  3052.    * "HighlightPixmap" == XmRPrimHighlightPixmap + XmRManHighlightPixmap
  3053.    */
  3054.   {":XMN_HIGHLIGHT_PIXMAP", &resclass_HighlightPixmap, XmNhighlightPixmap}, /* in Xm/Primitive.c -- XmRPrimHighlightPixmap; Xm/Manager.c -- XmRManHighlightPixmap */
  3055.   /*
  3056.    * "TopShadowPixmap" == XmRPrimTopShadowPixmap + XmRManTopShadowPixmap
  3057.    */
  3058.   {":XMN_TOP_SHADOW_PIXMAP", &resclass_TopShadowPixmap, XmNtopShadowPixmap}, /* in Xm/Primitive.c -- XmRPrimTopShadowPixmap; Xm/Manager.c -- XmRManTopShadowPixmap */
  3059.   /*
  3060.    * "BottomShadowPixmap" == XmRPrimBottomShadowPixmap + XmRManBottomShadowPixmap
  3061.    */
  3062.   {":XMN_BOTTOM_SHADOW_PIXMAP", &resclass_BottomShadowPixmap, XmNbottomShadowPixmap}, /* in Xm/Primitive.c -- XmRPrimBottomShadowPixmap; Xm/Manager.c -- XmRManBottomShadowPixmap */
  3063.   /*----------------------------------------------------------------------------
  3064.    *----------------- XmRShellHorizPos & XmRHorizontalPosition -----------------
  3065.    *----------------------------------------------------------------------------*/
  3066. #ifdef WINTERP_MOTIF_11
  3067.   {":XMN_X", &resclass_XmRHorizontalPosition, XmNx}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c Xm/Vendor.c(as XmRShellHorizPos) Xt/RectObj.c(as XtRPosition) Xt/Shell.c(as XtRPosition) */
  3068.   {":XMN_SASH_INDENT", &resclass_XmRHorizontalPosition, XmNsashIndent},    /* Xm/PanedW.c */
  3069. #else                /* MOTIF 1.0 */
  3070.   {":XMN_X", &resclass_XmRPosition, XmNx}, /* Xt:RectObj.c */
  3071.   {":XMN_SASH_INDENT", &resclass_XmRPosition, XmNsashIndent}, /* Xm:PanedW.c */
  3072. #endif                /* WINTERP_MOTIF_11 */
  3073.   /*----------------------------------------------------------------------------
  3074.    *---------------- XmRShellVertPos & XmRVerticalPosition  --------------------
  3075.    *----------------------------------------------------------------------------*/
  3076. #ifdef WINTERP_MOTIF_11
  3077.   {":XMN_Y", &resclass_XmRVerticalPosition, XmNy}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c Xm/Vendor.c(as XmRShellVertPos) Xt/RectObj.c(as XtRPosition) Xt/Shell.c(as XtRPosition) */
  3078. #else                /* MOTIF 1.0 */
  3079.   {":XMN_Y", &resclass_XmRPosition, XmNy}, /* Xt:RectObj.c */
  3080. #endif                /* WINTERP_MOTIF_11 */
  3081.   /*----------------------------------------------------------------------------
  3082.    *----------------------------  XmRProcessingDirection  ----------------------
  3083.    *----------------------------------------------------------------------------*/
  3084.   {":XMN_PROCESSING_DIRECTION", &resclass_XmRProcessingDirection, XmNprocessingDirection}, /* Xm/Scale.c Xm/ScrollBar.c */
  3085.   /*----------------------------------------------------------------------------
  3086.    *------------------------------ XmRResizePolicy  ----------------------------
  3087.    *----------------------------------------------------------------------------*/
  3088.   {":XMN_RESIZE_POLICY", &resclass_XmRResizePolicy, XmNresizePolicy}, /* Xm/BulletinB.c Xm/Command.c Xm/DrawingA.c */
  3089.   /*----------------------------------------------------------------------------
  3090.    *----------------------------- XmRRowColumnType -----------------------------
  3091.    *----------------------------------------------------------------------------*/
  3092.   {":XMN_ROW_COLUMN_TYPE", &resclass_XmRRowColumnType, XmNrowColumnType}, /* Xm:RowColumn.c */
  3093.   /*----------------------------------------------------------------------------
  3094.    *-------------------------- XmRScrollBarDisplayPolicy -----------------------
  3095.    *----------------------------------------------------------------------------*/
  3096.   {":XMN_SCROLL_BAR_DISPLAY_POLICY", &resclass_XmRScrollBarDisplayPolicy, XmNscrollBarDisplayPolicy}, /* Xm/List.c Xm/ScrolledW.c */
  3097.   /*----------------------------------------------------------------------------
  3098.    *-------------------------- XmRScrollBarPlacement ---------------------------
  3099.    *----------------------------------------------------------------------------*/
  3100.   {":XMN_SCROLL_BAR_PLACEMENT", &resclass_XmRScrollBarPlacement, XmNscrollBarPlacement}, /* Xm/ScrolledW.c */
  3101.   /*----------------------------------------------------------------------------
  3102.    *---------------------------- XmRScrollingPolicy ----------------------------
  3103.    *----------------------------------------------------------------------------*/
  3104.   {":XMN_SCROLLING_POLICY", &resclass_XmRScrollingPolicy, XmNscrollingPolicy}, /* Xm/ScrolledW.c */
  3105.   /*----------------------------------------------------------------------------
  3106.    *---------------------------- "XmRSelectionArray" ---------------------------
  3107.    *----------------------------------------------------------------------------*/
  3108.   /**
  3109.    ** NOTE that there is no "XmRSelectionArray" resource type in Motif/Xt.
  3110.    ** Resource XmNselectionArray is declared as XmRPointer, and you can't
  3111.    ** do much with such a vague type.
  3112.    **/
  3113.   {":XMN_SELECTION_ARRAY", &resclass_XmRSelectionArray, XmNselectionArray}, /* Xm/TextF.c Xm/TextIn.c */
  3114.   /*----------------------------------------------------------------------------
  3115.    *---------------------------- XmRSelectionPolicy ----------------------------
  3116.    *----------------------------------------------------------------------------*/
  3117.   {":XMN_SELECTION_POLICY", &resclass_XmRSelectionPolicy, XmNselectionPolicy}, /* Xm/List.c */
  3118.   /*----------------------------------------------------------------------------
  3119.    *----------------------------- XmRSeparatorType  ----------------------------
  3120.    *----------------------------------------------------------------------------*/
  3121.   {":XMN_SEPARATOR_TYPE", &resclass_XmRSeparatorType, XmNseparatorType}, /* Xm/SeparatoG.c Xm/Separator.c */
  3122.   /*----------------------------------------------------------------------------
  3123.    *------------------------------- XmRShadowType ------------------------------
  3124.    *----------------------------------------------------------------------------*/
  3125.   {":XMN_SHADOW_TYPE", &resclass_XmRShadowType, XmNshadowType},    /* Xm/BulletinB.c Xm/DrawnB.c Xm/Frame.c */
  3126.   /*----------------------------------------------------------------------------
  3127.    *--------------------------------  XmRShort  --------------------------------
  3128.    *----------------------------------------------------------------------------*/
  3129.   {":XMN_NUM_COLUMNS", &resclass_XmRShort, XmNnumColumns}, /* Xm/RowColumn.c */
  3130.   {":XMN_DECIMAL_POINTS", &resclass_XmRShort, XmNdecimalPoints}, /* Xm/Scale.c */
  3131.   {":XMN_TEXT_COLUMNS", &resclass_XmRShort, XmNtextColumns}, /* Xm/SelectionB.c */
  3132.   {":XMN_COLUMNS", &resclass_XmRShort, XmNcolumns}, /* Xm/TextF.c Xm/TextOut.c */
  3133.   {":XMN_ROWS", &resclass_XmRShort, XmNrows}, /* Xm/TextOut.c */
  3134.   /*----------------------------------------------------------------------------
  3135.    *--------------------------------- XmRString --------------------------------
  3136.    *----------------------------------------------------------------------------*/
  3137.   {":XMN_ACCELERATOR", &resclass_XmRString, XmNaccelerator}, /* Xm/Label.c Xm/LabelG.c */
  3138. #ifdef WINTERP_MOTIF_11
  3139.   {":XMN_MENU_POST", &resclass_XmRString, XmNmenuPost}, /* Xm/RowColumn.c */ /* a new resource for Motif 1.1 */
  3140.   {":XMN_MNEMONIC_CHAR_SET", &resclass_XmRString, XmNmnemonicCharSet},    /* Xm/Label.c /Xm/LabelG.c Xm/RowColumn.c */
  3141. #endif                /* WINTERP_MOTIF_11 */
  3142.   {":XMN_MENU_ACCELERATOR", &resclass_XmRString, XmNmenuAccelerator}, /* Xm/RowColumn.c */
  3143.   /*
  3144.    * Note potential BUG due to Motif's braindamage -- XmRString resource XmNvalue in Xm/Text.c
  3145.    * conflicts with XmNvalue which is used as an int in Xm/Scale.c and Xm/ScrollBar.c. 
  3146.    * For those wanting to use XtGetValues()/XtSetValues(), an alias resource called
  3147.    * :XMN_STRING has been provided. Alternately, use XmText widget methods
  3148.    * :GET_STRING and :SET_STRING.
  3149.    */
  3150.   {":XMN_STRING", &resclass_XmRString, XmNvalue}, /* Xm/TextF.c Xm:Text.c */
  3151.   {":XMN_MWM_MENU", &resclass_XmRString, XmNmwmMenu}, /* Xm/VendorE.c */
  3152.   /* {":DEFAULT_VIRTUAL_BINDINGS", &resclass_XmRString, "defaultVirtualBindings"}, -- this is a weird resource, doesn't seem settable */ /* Xm/VirtKeys.c */ /* a new resource for Motif 1.1 */
  3153.   /*
  3154.    * XmNgeometry is supposed to be a normal XmRString resource. In reality, it behaves somewhat
  3155.    * differently, at least in Motif 1.1. XmRString resources are supposed to be copied
  3156.    * into the widget at creation-time. This one doesn't get copied, and you would
  3157.    * see potential errors when the string value you set for XmNgeometry gets garbage-collected...
  3158.    * The solution is to create a special version of resclass_XmRString which copies the
  3159.    * string...
  3160.    */
  3161.   {":XMN_GEOMETRY", &resclass_XmRString_for_XmNgeometry, XmNgeometry}, /* Xt/Shell.c */
  3162.   {":XMN_TITLE", &resclass_XmRString, XmNtitle}, /* Xt/Shell.c */
  3163.   {":XMN_ICON_NAME", &resclass_XmRString, XmNiconName},    /* Xt:Shell.c -- toplevelshell only */
  3164.   /*----------------------------------------------------------------------------
  3165.    *--------------------------- XmRStringDirection -----------------------------
  3166.    *----------------------------------------------------------------------------*/
  3167.   {":XMN_STRING_DIRECTION", &resclass_XmRStringDirection, XmNstringDirection}, /* Xm/Label.c Xm/LabelG.c Xm/List.c Xm/Manager.c(in Motif 1.1) Xm:BulletinB.c(in Motif 1.0) */
  3168.   /*----------------------------------------------------------------------------
  3169.    *----------------------------- XmRStringTable -------------------------------
  3170.    *---------------------------------------------------------------------------*/
  3171. #ifdef WINTERP_MOTIF_11
  3172.   /*
  3173.    * XmNbuttonMnemonicCharSets is declared as XmRCharSetTable, however, it looks
  3174.    * like CharSets are just strings, and so CharSetTable == StringTable.
  3175.    */
  3176.   {":XMN_BUTTON_MNEMONIC_CHAR_SETS", &resclass_XmRStringTable, XmNbuttonMnemonicCharSets}, /* Xm/Simple.c */
  3177.   {":XMN_BUTTON_ACCELERATORS", &resclass_XmRStringTable, XmNbuttonAccelerators}, /* Xm/Simple.c */
  3178. #endif                /* WINTERP_MOTIF_11 */
  3179.   /*
  3180.    * XmNargv is declared as an XtRStringArray in 1.1, and as XmRPointer in 1.0. In
  3181.    * reality, it expects a table of strings, so putting this resource under
  3182.    * XmRStringTable seems logical.
  3183.    *
  3184.    * Unfortunately, XmNargv doesn't work in the way that most resources work -- 
  3185.    * it does not copy the strings in the table of strings. Since the other
  3186.    * XmRStringTable resources above do that, XmNargv should not be settable
  3187.    * via XtSetValues() nor XtCreate...(). Use
  3188.    * method (send <application-shell-widget> :SET_ARGV). Likewise, to retrieve
  3189.    * this resource, use method (send <application-shell-widget> :GET_ARGV)
  3190.    */
  3191. #ifdef THE_FOLLOWING_CODE_IS_COMMENTED_OUT
  3192.   {":XMN_ARGV", &resclass_XmRStringTable, XmNargv}, /* Xt/Shell.c (application shell only) */
  3193. #endif                /* THE_FOLLOWING_CODE_IS_COMMENTED_OUT */
  3194.   /*----------------------------------------------------------------------------
  3195.    *------------------------------- XmRTextPosition ----------------------------
  3196.    *----------------------------------------------------------------------------*/
  3197. #ifdef WINTERP_MOTIF_11
  3198.   {":XMN_TOP_CHARACTER", &resclass_XmRTextPosition, XmNtopCharacter}, /* Xm/Text.c */ /* a new resource for MOTIF 1.1 */
  3199.   {":XMN_CURSOR_POSITION", &resclass_XmRTextPosition, XmNcursorPosition}, /* Xm/Text.c Xm/TextF.c */
  3200. #else                /* MOTIF 1.0 */
  3201.   {":XMN_CURSOR_POSITION", &resclass_XmRInt, XmNcursorPosition}, /* Xm:Text.c */
  3202. #endif                /* WINTERP_MOTIF_11 */
  3203.   /*----------------------------------------------------------------------------
  3204.    *---------------------------- XmRTranslationTable ---------------------------
  3205.    *----------------------------------------------------------------------------*/
  3206.   {":XMN_TEXT_TRANSLATIONS", &resclass_XmRTranslationTable, XmNtextTranslations}, /* Xm/BulletinB.c */
  3207.   {":XMN_TRANSLATIONS", &resclass_XmRTranslationTable, XmNtranslations}, /* Xt/Core.c */
  3208.   /*----------------------------------------------------------------------------
  3209.    *-------------------------------- XmRUnitType -------------------------------
  3210.    *----------------------------------------------------------------------------*/
  3211.   {":XMN_UNIT_TYPE", &resclass_XmRUnitType, XmNunitType}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c */
  3212.   {":XMN_SHELL_UNIT_TYPE", &resclass_XmRUnitType, XmNshellUnitType}, /* Xm/Vendor.c -- note: this is listed as XmRShellUnitType which is same as XmRUnitType */
  3213.   /*----------------------------------------------------------------------------
  3214.    *------------------------------  XmRVisualPolicy ----------------------------
  3215.    *----------------------------------------------------------------------------*/
  3216.   {":XMN_VISUAL_POLICY", &resclass_XmRVisualPolicy, XmNvisualPolicy}, /* Xm/ScrolledW.c */
  3217.   /*----------------------------------------------------------------------------
  3218.    *------------------------------- XmRWhichButton -----------------------------
  3219.    *----------------------------------------------------------------------------*/
  3220.   {":XMN_WHICH_BUTTON", &resclass_XmRWhichButton, XmNwhichButton}, /* Xm/RowColumn.c */
  3221.   /*----------------------------------------------------------------------------
  3222.    *-------------------------------- XmRWidget ---------------------------------
  3223.    *----------------------------------------------------------------------------*/
  3224.   /**
  3225.    ** Note that representation type XmRWidget has been "underloaded" in Motif. 
  3226.    ** That is, resources declard as XmRWindow, XmRMenuWidget, and XmRWidget have
  3227.    ** values that are widgetID's (assoc'd w/ WIDGETOBJ's in WINTERP).
  3228.    ** Therefore I've put all these together into type XmRWidget. Since Motif 1.1
  3229.    ** has no string-->widget resource converter we don't need to worry about the
  3230.    ** naming diffs between XmRWindow,XmRMenuWidget and XmRWidget.
  3231.    **/
  3232. #ifdef WINTERP_MOTIF_11
  3233.   {":XMN_TRANSIENT_FOR", &resclass_XmRWidget, XmNtransientFor}, /* Xt/Shell.c --- transient shell only */ /* a new resource for Motif 1.1 */
  3234. #endif                /* WINTERP_MOTIF_11 */
  3235.   /**
  3236.    ** The following resources were declared as XmRMenuWidget, but they're being
  3237.    ** thrown into type XmRWidget since the resource values represent widgetID's.
  3238.    **/
  3239.   {":XMN_SUB_MENU_ID", &resclass_XmRWidget, XmNsubMenuId}, /* Xm/CascadeB.c Xm/CascadeBG.c Xm/RowColumn.c */
  3240.   {":XMN_MENU_HELP_WIDGET", &resclass_XmRWidget, XmNmenuHelpWidget}, /* Xm/RowColumn.c -- used only for XmMENU_BAR */
  3241.   {":XMN_MENU_HISTORY", &resclass_XmRWidget, XmNmenuHistory}, /* Xm/RowColumn.c -- last activated menu entry */
  3242.  
  3243.   /**
  3244.    ** The following resources were declared as XmRWindow, but they're being
  3245.    ** thrown into type XmRWidget since the resource values represent widgetID's.
  3246.    ** (Note that the declaration doesn't correspond to usage in source nor
  3247.    ** verbiage in documentation)
  3248.    **/
  3249.   {":XMN_DEFAULT_BUTTON", &resclass_XmRWidget, XmNdefaultButton}, /* Xm/BulletinB.c */
  3250.   {":XMN_CANCEL_BUTTON", &resclass_XmRWidget, XmNcancelButton},    /* Xm/BulletinB.c */
  3251.   {":XMN_TOP_WIDGET", &resclass_XmRWidget, XmNtopWidget}, /* Xm/Form.c */
  3252.   {":XMN_BOTTOM_WIDGET", &resclass_XmRWidget, XmNbottomWidget},    /* Xm/Form.c */
  3253.   {":XMN_LEFT_WIDGET", &resclass_XmRWidget, XmNleftWidget}, /* Xm/Form.c */
  3254.   {":XMN_RIGHT_WIDGET", &resclass_XmRWidget, XmNrightWidget}, /* Xm/Form.c */
  3255.   {":XMN_HORIZONTAL_SCROLL_BAR", &resclass_XmRWidget, XmNhorizontalScrollBar}, /* Xm/List.c Xm/ScrolledW.c */
  3256.   {":XMN_VERTICAL_SCROLL_BAR", &resclass_XmRWidget, XmNverticalScrollBar}, /* Xm/List.c Xm/ScrolledW.c */
  3257.   {":XMN_COMMAND_WINDOW", &resclass_XmRWidget, XmNcommandWindow}, /* Xm/MainW.c */
  3258.   {":XMN_MENU_BAR", &resclass_XmRWidget, XmNmenuBar}, /* Xm/MainW.c */
  3259. #ifdef WINTERP_MOTIF_11
  3260.   {":XMN_MESSAGE_WINDOW", &resclass_XmRWidget, XmNmessageWindow}, /* Xm/MainW.c */ /* a new resource for Motif 1.1 */
  3261. #endif                /* WINTERP_MOTIF_11 */
  3262.   {":XMN_WORK_WINDOW", &resclass_XmRWidget, XmNworkWindow}, /* Xm/ScrolledW.c */
  3263.   {":XMN_CLIP_WINDOW", &resclass_XmRWidget, XmNclipWindow}, /* Xm/ScrolledW.c */
  3264. #ifdef THE_FOLLOWING_CODE_IS_COMMENTED_OUT
  3265.   /* 
  3266.    * XmNdesktopParent/XmNlogicalParent resources are strange:
  3267.    *     It seems to be a part of the extension/desktop object, not a widget;
  3268.    *     It has no documentation.
  3269.    * Therefore, I'm assuming this is an internal resource and I'm not
  3270.    * going to bother interfacing it.
  3271.    */
  3272.   {":XMN_DESKTOP_PARENT", &resclass_XmRWidget, XmNdesktopParent}, /* Xm/Desktop.c: */
  3273.   {":XMN_LOGICAL_PARENT", &resclass_XmRWidget, XmNlogicalParent}, /* Xm/ExtObject.c */
  3274. #endif                /* THE_FOLLOWING_CODE_IS_COMMENTED_OUT */
  3275.   /*----------------------------------------------------------------------------
  3276.    *------------------------------ "XmRWidgetClass" ----------------------------
  3277.    *----------------------------------------------------------------------------*/
  3278.   /*
  3279.    * Note: in Xm/RowColumn.c, XmNentryClass/XmCEntryClass resource is coded
  3280.    * as being of representation type XmRInt, when it's value is supposed to hold
  3281.    * a widget class pointer. So we create a fake, new representation type
  3282.    * XmRWidgetClass for this resource.
  3283.    */
  3284.   {":XMN_ENTRY_CLASS", &resclass_XmRWidgetClass, XmNentryClass}, /* Xm:RowColumn.c */
  3285.   /*----------------------------------------------------------------------------
  3286.    *----------------------------      XmRWindow      ---------------------------
  3287.    *----------------------------------------------------------------------------*/
  3288.   {":XMN_WINDOW_GROUP", &resclass_XmRWindow, XmNwindowGroup}, /* Xm/Vendor.c Xt/Shell.c */
  3289.   {":XMN_ICON_WINDOW", &resclass_XmRWindow, XmNiconWindow}, /* Xt/Shell.c */
  3290.   /*----------------------------------------------------------------------------
  3291.    *----------------------------  XmRWindowGravity   ---------------------------
  3292.    *----------------------------------------------------------------------------*/
  3293. #ifdef WINTERP_MOTIF_11
  3294.   /*
  3295.    * Note -- resource XmNwinGravity is defined as XmRInt, but it is really an
  3296.    * enumerated type -- one of 10 different specifiers for "window gravity".
  3297.    * This is a fake representation type -- neither Motif nor Xt define "XmRWindowGravity"
  3298.    */
  3299.   {":XMN_WIN_GRAVITY", &resclass_XmRWindowGravity, XmNwinGravity}, /* Xt/Shell.c */ /* a new resource for MOTIF 1.1 */
  3300. #endif                /* WINTERP_MOTIF_11 */
  3301.   /*----------------------------------------------------------------------------
  3302.    *-------------------------------- XmRXmString -------------------------------
  3303.    *----------------------------------------------------------------------------*/
  3304.   {":XMN_DIALOG_TITLE", &resclass_XmRXmString, XmNdialogTitle},    /* Xm/BulletinB.c */
  3305.   {":XMN_PROMPT_STRING", &resclass_XmRXmString, XmNpromptString}, /* Xm/Command.c */
  3306.   {":XMN_COMMAND", &resclass_XmRXmString, XmNcommand}, /* Xm/Command.c */
  3307.   {":XMN_LABEL_STRING", &resclass_XmRXmString, XmNlabelString},    /* Xm/DrawnB.c Xm/Label.c Xm/LabelG.c Xm/RowColumn.c */
  3308. #ifdef WINTERP_MOTIF_11
  3309.   {":XMN_DIRECTORY", &resclass_XmRXmString, XmNdirectory}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  3310.   {":XMN_PATTERN", &resclass_XmRXmString, XmNpattern}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  3311.   {":XMN_DIR_LIST_LABEL_STRING", &resclass_XmRXmString, XmNdirListLabelString}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  3312. #endif                /* WINTERP_MOTIF_11 */
  3313.   {":XMN_FILTER_LABEL_STRING", &resclass_XmRXmString, XmNfilterLabelString}, /* Xm/FileSB.c */
  3314.   {":XMN_DIR_MASK", &resclass_XmRXmString, XmNdirMask},    /* Xm/FileSB.c */
  3315. #ifdef WINTERP_MOTIF_11
  3316.   {":XMN_NO_MATCH_STRING", &resclass_XmRXmString, XmNnoMatchString}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  3317. #endif                /* WINTERP_MOTIF_11 */
  3318.   {":XMN_DIR_SPEC", &resclass_XmRXmString, XmNdirSpec},    /* Xm/FileSB.c */
  3319. #ifdef WINTERP_MOTIF_11
  3320.   {":XMN_FILE_LIST_LABEL_STRING", &resclass_XmRXmString, XmNfileListLabelString}, /* Xm/FileSB.c */ /* a new resource for MOTIF 1.1 */
  3321. #endif                /* WINTERP_MOTIF_11 */
  3322.   {":XMN_APPLY_LABEL_STRING", &resclass_XmRXmString, XmNapplyLabelString}, /* Xm/FileSB.c Xm/SelectioB.c */
  3323.   {":XMN_ACCELERATOR_TEXT", &resclass_XmRXmString, XmNacceleratorText},    /* Xm/Label.c Xm/LabelG.c */
  3324.   {":XMN_MESSAGE_STRING", &resclass_XmRXmString, XmNmessageString}, /* Xm/MessageB.c */
  3325.   {":XMN_OK_LABEL_STRING", &resclass_XmRXmString, XmNokLabelString}, /* Xm/MessageB.c Xm/SelectioB.c */
  3326.   {":XMN_CANCEL_LABEL_STRING", &resclass_XmRXmString, XmNcancelLabelString}, /* Xm/MessageB.c Xm/SelectioB.c */
  3327.   {":XMN_HELP_LABEL_STRING", &resclass_XmRXmString, XmNhelpLabelString}, /* Xm/MessageB.c Xm/SelectioB.c */
  3328.   {":XMN_TITLE_STRING", &resclass_XmRXmString, XmNtitleString},    /* Xm/Scale.c */
  3329.   {":XMN_SELECTION_LABEL_STRING", &resclass_XmRXmString, XmNselectionLabelString}, /* Xm/SelectioB.c */
  3330.   {":XMN_LIST_LABEL_STRING", &resclass_XmRXmString, XmNlistLabelString}, /* Xm/FileSB.c Xm/SelectioB.c */
  3331.   {":XMN_TEXT_STRING", &resclass_XmRXmString, XmNtextString}, /* Xm/SelectioB.c */
  3332. #ifdef WINTERP_MOTIF_11
  3333.   {":XMN_OPTION_LABEL", &resclass_XmRXmString, XmNoptionLabel}, /* Xm/Simple.c -- XmSimpleMenu */ /* a new resource for MOTIF 1.1 */
  3334. #endif                /* WINTERP_MOTIF_11 */
  3335.   /*----------------------------------------------------------------------------
  3336.    *------------------------------ XmRXmStringTable ----------------------------
  3337.    *----------------------------------------------------------------------------*/
  3338.   {":XMN_HISTORY_ITEMS", &resclass_XmRXmStringTable, XmNhistoryItems}, /* Xm/Command.c */
  3339. #ifdef WINTERP_MOTIF_11
  3340.   {":XMN_DIR_LIST_ITEMS", &resclass_XmRXmStringTable, XmNdirListItems}, /* Xm/FileSB.c */
  3341.   {":XMN_FILE_LIST_ITEMS", &resclass_XmRXmStringTable, XmNfileListItems}, /* Xm/FileSB.c */
  3342. #endif                /* WINTERP_MOTIF_11 */
  3343.   {":XMN_ITEMS", &resclass_XmRXmStringTable, XmNitems},    /* Xm/List.c */
  3344.   {":XMN_SELECTED_ITEMS", &resclass_XmRXmStringTable, XmNselectedItems}, /* Xm/List.c */
  3345.   {":XMN_LIST_ITEMS", &resclass_XmRXmStringTable, XmNlistItems}, /* Xm/SelectioB.c */
  3346. #ifdef WINTERP_MOTIF_11
  3347.   {":XMN_BUTTONS", &resclass_XmRXmStringTable, XmNbuttons}, /* Xm/Simple.c -- Note: creation-time only resource */
  3348.   {":XMN_BUTTON_ACCELERATOR_TEXT", &resclass_XmRXmStringTable, XmNbuttonAcceleratorText}, /* Xm/Simple.c -- Note: creation-time only resource */
  3349. #endif                /* WINTERP_MOTIF_11 */
  3350.   /*----------------------------------------------------------------------------
  3351.    *------ RESOURCES FOR THE HP GRAPH WIDGET (currently Motif 1.0 only) --------
  3352.    *----------------------------------------------------------------------------*/
  3353. #ifdef HP_GRAPH_WIDGET
  3354.   {":XMN_TO", &resclass_XmRWidget, XmNto}, /* XmGraph/Arc.c */
  3355.   {":XMN_FROM", &resclass_XmRWidget, XmNfrom}, /* XmGraph/Arc.c */
  3356.   {":XMN_INTERACTIVE_ARC_DIRECTION", &resclass_XmRArcDirection, XmNinteractiveArcDirection}, /* XmGraph/Graph.c */
  3357.   {":XMN_ARC_DIRECTION", &resclass_XmRArcDirection, XmNarcDirection}, /* XmGraph/Arc.c */
  3358.   {":XMN_HIGHLIGHT", &resclass_XmRBoolean, XmNhighlight}, /* XmGraph/Arc.c */  
  3359.   {":XMN_MAP_LABEL", &resclass_XmRBoolean, XmNmapLabel}, /* XmGraph/Arc.c */  
  3360.   {":XMN_MOVABLE_NODES", &resclass_XmRBoolean, XmNmovableNodes}, /* XmGraph/Graph.c */  
  3361.   {":XMN_AUTO_LAYOUT_MODE", &resclass_XmRBoolean, XmNautoLayoutMode}, /* XmGraph/Graph.c */  
  3362.   {":XMN_RE_LAYOUT", &resclass_XmRBoolean, XmNreLayout}, /* XmGraph/Graph.c */  
  3363.   {":XMN_REORIENT", &resclass_XmRBoolean, XmNreorient},    /* XmGraph/Graph.c */  
  3364.   {":XMN_TWINS_VISIBLE", &resclass_XmRBoolean, XmNtwinsVisible}, /* XmGraph/Graph.c */  
  3365.   {":XMN_DELTA", &resclass_XmRInt, XmNdelta}, /* XmGraph/Arc.c */
  3366.   {":XMN_ARC_WIDTH", &resclass_XmRInt, XmNarcWidth}, /* XmGraph/Arc.c */
  3367.   {":XMN_DASHES", &resclass_XmRInt, XmNdashes},    /* XmGraph/Arc.c */
  3368.   {":XMN_DASH_OFFSET", &resclass_XmRInt, XmNdashOffset}, /* XmGraph/Arc.c */
  3369.   {":XMN_CHILD_SPACING", &resclass_XmRShort, XmNchildSpacing}, /* XmGraph/Graph.c */
  3370.   {":XMN_SIBLING_SPACING", &resclass_XmRShort, XmNsiblingSpacing}, /* XmGraph/Graph.c */
  3371.   /*
  3372.     {":XmNfont", &resclass_XmRFontStruct, XmNfont},
  3373.     The XM_ARC_WIDGET_CLASS defines a resource XmNfont, but I'm ignoring it 
  3374.     for now because XmGraph will eventually support the correct resource -- XmNfontList
  3375.     */
  3376.   {":XMN_LABEL", &resclass_XmRString, XmNlabel}, /* XmGraph/Arc.c */
  3377.   {":XMN_DEFAULT_LABEL", &resclass_XmRXmString, XmNdefaultLabel}, /* XmGraph/Graph.c */
  3378.   {":XMN_STYLE", &resclass_XmRLineStyle, XmNstyle}, /* XmGraph/Arc.c */
  3379.   {":XMN_CAP_STYLE", &resclass_XmRCapStyle, XmNcapStyle}, /* XmGraph/Arc.c */
  3380.   {":XMN_ARC_DRAW_MODE", &resclass_XmRArcDrawMode, XmNarcDrawMode}, /* XmGraph/Graph.c */
  3381.   {":XMN_ARC_EDITED_CALLBACK", &resclass_XmRCallback, XmNarcEditedCallback}, /* XmGraph/Arc.c */
  3382.   {":XMN_NEW_ARC_CALLBACK", &resclass_XmRCallback, XmNnewArcCallback}, /* XmGraph/Graph.c */
  3383.   {":XMN_NEW_NODE_CALLBACK", &resclass_XmRCallback, XmNnewNodeCallback}, /* XmGraph/Graph.c */
  3384.   {":XMN_NODE_MOVED_CALLBACK", &resclass_XmRCallback, XmNnodeMovedCallback}, /* XmGraph/Graph.c */
  3385.   {":XMN_ARC_MOVED_CALLBACK", &resclass_XmRCallback, XmNarcMovedCallback}, /* XmGraph/Graph.c */
  3386.   {":XMN_DEFAULT_ACTION_CALLBACK", &resclass_XmRCallback, XmNdefaultActionCallback}, /* XmGraph/Graph.c */
  3387.   {":XMN_DELETE_NODE_CALLBACK", &resclass_XmRCallback, XmNdeleteNodeCallback}, /* XmGraph/Graph.c */
  3388.   {":XMN_DELETE_ARC_CALLBACK", &resclass_XmRCallback, XmNdeleteArcCallback}, /* XmGraph/Graph.c */
  3389.   {":XMN_SELECT_NODE_CALLBACK", &resclass_XmRCallback, XmNselectNodeCallback}, /* XmGraph/Graph.c */
  3390.   {":XMN_DESELECT_CALLBACK", &resclass_XmRCallback, XmNdeselectCallback}, /* XmGraph/Graph.c */
  3391.   {":XMN_SELECT_ARC_CALLBACK", &resclass_XmRCallback, XmNselectArcCallback}, /* XmGraph/Graph.c */
  3392.   {":XMN_SELECT_SUBGRAPH_CALLBACK", &resclass_XmRCallback, XmNselectSubgraphCallback}, /* XmGraph/Graph.c */
  3393.   {":XMN_DEFAULT_NODE_CLASS", &resclass_XmRWidgetClass, XmNdefaultNodeClass}, /* XmGraph/Graph.c */
  3394. #endif                /* HP_GRAPH_WIDGET */
  3395.  
  3396. #ifdef THE_FOLLOWING_CODE_IS_COMMENTED_OUT /* WINTERP IGNORES THE FOLLOWING RESOURCES: */
  3397.   {":XMN_SIMPLE_CALLBACK", &resclass_XmRCallbackProc, XmNsimpleCallback}, /* Xm/Simple.c */
  3398.   /*
  3399.    * XmNchildren and XmNnumChildren are retrieved through method
  3400.    * (send <composite> :get_children) -- wc_WIDGET.c:Widget_Class_Method_GET_CHILDREN().
  3401.    * Justification: these resources are read-only so it doesn't make sense to make a
  3402.    * normal XtGetValues()/XtSetValues() interface. Furthermore, since the array
  3403.    * XmNchildren isn't NULL terminated we'd have to pickup XmNnumChildren...
  3404.    * that would require a gross hack and it's much simpler to provide a method for that functionality.
  3405.    */
  3406.   {":XMN_NUM_CHILDREN", &resclass_XmRCardinal, XmNnumChildren},    /* Xt/Composite.c */ /* READ-ONLY resource */
  3407.   {":XMN_CHILDREN", &resclass_XmRWidgetList, XmNchildren},    /* Xt/Composite.c */ /* READ-ONLY resource */
  3408.   /*
  3409.    * XmNpostFromList and XmNpostFromCount seem to be internal resources on
  3410.    * XmRowColumn, so I'm not going to interface 'em. If you need these, add
  3411.    * a method on XM_ROW_COLUMN_WIDGET_CLASS that is similar to
  3412.    * wc_WIDGET.c:Widget_Class_Method_GET_CHILDREN().
  3413.    */
  3414.   {":XMN_POST_FROM_COUNT", &resclass_XmRInt, XmNpostFromCount},    /* Xm/RowColumn.c */ /* READ-ONLY resource */
  3415.   {":XMN_POST_FROM_LIST", &resclass_XmRWidgetList, XmNpostFromList},    /* Xm/RowColumn.c */ /* READ-ONLY resource */
  3416.   {":XMN_COLORMAP", &resclass_XtRColormap, XmNcolormap},    /* Xt/Core.c Xt/Shell.c */
  3417.   /*
  3418.    * TO-DO LATER For now, I'm not going to bother with these resources, since
  3419.    * I don't have any other atom-level interfaces in WINTERP yet. 
  3420.    */
  3421.   /* {":XMN_ATOM", &resclass_XmRAtom, XmNatom}, -- looks like a non-widget resource */ /* Xm/Protocols.c */
  3422.   {":XMN_TITLE_ENCODING", &resclass_XmRAtom, XmNtitleEncoding}, /* Xt/Shell.c */
  3423.   {":XMN_ICON_NAME_ENCODING", &resclass_XmRAtom, XmNiconNameEncoding}, /* Xt/Shell.c */
  3424.   /* 
  3425.    * XmRExtensionType resource XmNextensionType is a strange resource:
  3426.    *     It seems to be a part of the extension object, not a widget;
  3427.    *     It has no external resource converter interface;
  3428.    *     It has no documentation.
  3429.    * Therefore, I'm assuming this is an internal resource and I'm not
  3430.    * going to bother interfacing it.
  3431.    */
  3432.   {":XMN_EXTENSION_TYPE", &resclass_XmRExtensionType, XmNextensionType}, /* Xm/Desktop.c Xm/ExtObject.c Xm/Protocols.c Xm/VendorE.c */
  3433.   /* 
  3434.    * XmRFunction resources can't be set/accessed in WINTERP:
  3435.    * This resource class is a C function-pointer. The kinds of things done by
  3436.    * these procedures are probalby too low-level to interface to the WINTERP-Lisp
  3437.    * evaluator (i.e. an interface making them work like callbacks).
  3438.    * If you need access to these in WINTERP the simplest thing to do is create a
  3439.    * trivial subclass of the desired widget such that this resource gets set to the
  3440.    * desired creation/insert/popup procedure that is implemented in C
  3441.    */
  3442.   {":XMN_OUTPUT_CREATE", &resclass_XmRFunction, XmNoutputCreate}, /* Xm/Text.c */
  3443.   {":XMN_INPUT_CREATE", &resclass_XmRFunction, XmNinputCreate},    /* Xm/Text.c */
  3444.   {":XMN_INSERT_POSITION", &resclass_XmRFunction, XmNinsertPosition}, /* Xt/Composite.c */
  3445.   {":XMN_CREATE_POPUP_CHILD_PROC", &resclass_XmRFunction, XmNcreatePopupChildProc}, /* Xt/Shell.c */
  3446.   /*
  3447.    * NOTE: since we're using the userdata field to hold a backpointer to the
  3448.    * widget object, then we shouldn't make it accessible to the user
  3449.    */ 
  3450.    {:XMN_USER_DATA,  &resclass_XmRPointer,  XmNuserData}, /* Xm/Gadget.c Xm/Manager.c Xm/Primitive.c */
  3451.   /*
  3452.    * You should write XmText XmNsource procedures in C anyways...
  3453.    * I'm not going to try to figure out how to interface this.
  3454.    */
  3455.   {":XMN_SOURCE", &resclass_XmRPointer, XmNsource}, /* Xm/Text.c */
  3456.   /*
  3457.    * XmRProc is a function pointer to a function declared:
  3458.    * void DoFileSearch(fs, search_data)
  3459.    *    XmFileSelectionBoxWidget fs;
  3460.    *    XmFileSelectionBoxCallbackStruct *search_data;
  3461.    *
  3462.    * I don't expect that people will be setting the file search procedure
  3463.    * inside lisp, since it needs to to alot of low level munging with the
  3464.    * list widget, therefore, for now, I'm going to ignore this type, and the
  3465.    * two associated resources. There's plenty of more important things to
  3466.    * get working... -- NPM.
  3467.    */
  3468.   {":XMN_QUALIFY_SEARCH_DATA_PROC", &resclass_XmRProc, XmNqualifySearchDataProc}, /* Xm/FileSB.c */
  3469.   {":XMN_DIR_SEARCH_PROC", &resclass_XmRProc, XmNdirSearchProc}, /* Xm/FileSB.c */
  3470.   {":XMN_FILE_SEARCH_PROC", &resclass_XmRProc, XmNfileSearchProc}, /* Xm/FileSB.c */
  3471.   {":XMN_SCREEN", &resclass_XmRScreen, XmNscreen}, /* Xt/Core.c */
  3472.   {":XMN_VISUAL", &resclass_XmRVisual, XmNvisual}, /* Xt/Shell.c */
  3473. #endif                /* THE_FOLLOWING_CODE_IS_COMMENTED_OUT */
  3474.  
  3475.   {NULL, NULL, NULL, NULL}    /* BY ALL MEANS NECESSARY -- end of table marker */
  3476. };
  3477.  
  3478. /**************************************************************************/
  3479. /**************************************************************************/
  3480. /**************************************************************************/
  3481. /**************************************************************************/
  3482.  
  3483. #define FREEABLES_SIZE_INCREMENT 20
  3484. static struct Argval_Deallocator_Pair {
  3485.   XtPointer pointer;
  3486.   void (*deallocator)();
  3487. } *freeables; /* initialized in Wres_Init() */
  3488. static int freeables_size;    /* maximum index based on size of freeables */
  3489. static int freeables_end_idx;    /* index of last elt in freeables */
  3490.  
  3491. /******************************************************************************
  3492.  * Wres_Free_C_Arglist_Data():
  3493.  *
  3494.  * This procedure frees any unneeded structures that were created by
  3495.  * Wres_Get_LispArglist(). It should be called only after the C arglist
  3496.  * returned by Wres_Get_LispArglist() is used by a widget creation routine
  3497.  * (see :isnew methods on widgets) or by XtSetValues().
  3498.  ******************************************************************************/
  3499. void Wres_Free_C_Arglist_Data()
  3500. {
  3501.   int i = 0;
  3502.   while (i < freeables_end_idx) {
  3503.     (*(freeables[i].deallocator))(freeables[i].pointer);
  3504.     i++;
  3505.   }
  3506.   freeables_end_idx = 0;    /* reset */
  3507. }
  3508.  
  3509.  
  3510. /******************************************************************************
  3511.  * Wres_Free_This_Later():
  3512.  *
  3513.  * Stores a pointer to an allocated chunk of memory, and a procedure to deallocate
  3514.  * that memory. This will get called upon calling Wres_Free_C_Arglist_Data().
  3515.  ******************************************************************************/
  3516. static void Wres_Free_This_Later(pointer, deallocator)
  3517.      XtPointer pointer;
  3518.      void (*deallocator)();
  3519. {
  3520.   if (freeables_end_idx >= freeables_size) {
  3521.     freeables = (struct Argval_Deallocator_Pair *) XtRealloc(freeables, (unsigned) ((freeables_size + FREEABLES_SIZE_INCREMENT) * sizeof(struct Argval_Deallocator_Pair)));
  3522.     freeables_size += FREEABLES_SIZE_INCREMENT;
  3523.   }
  3524.   freeables[freeables_end_idx].pointer = pointer;
  3525.   freeables[freeables_end_idx].deallocator = deallocator;
  3526.   freeables_end_idx++;
  3527. }
  3528.  
  3529. /**************************************************************************/
  3530. /**************************************************************************/
  3531. /**************************************************************************/
  3532. /**************************************************************************/
  3533.  
  3534. static Pixmap Wres_Get_Pixmap(scr, fg, bg, lval_resval, resource, o_widget)
  3535.      Screen*            scr;
  3536.      Pixel              fg;
  3537.      Pixel              bg;
  3538.      LVAL               lval_resval; /* STRING */
  3539.      Resource_Instance* resource;
  3540.      LVAL               o_widget; /* WIDGETOBJ */
  3541. {
  3542.   extern void Wpm_Set_Pixmap_Reference(); /* w_pixmap.c */
  3543.   Pixmap result;
  3544.  
  3545.   if ((result = XmGetPixmap(scr, (char*) getstring(lval_resval), fg, bg)) == XmUNSPECIFIED_PIXMAP) {
  3546.     sprintf(temptext,
  3547.         "Resource %s (type XmR%s) -- XmGetPixmap() couldn't create a pixmap from given string pixmap specification.",
  3548.         resource->printname,
  3549.         resource->class->XmR_type);
  3550.     xlerror(temptext, lval_resval);
  3551.   }
  3552.   Wpm_Set_Pixmap_Reference(cv_pixmap(result), o_widget, resource->symbol);
  3553.   return (result);
  3554. }
  3555.  
  3556. /*****************************************************************************
  3557.  * Wres_Get_LispArglist():
  3558.  *
  3559.  * This routine will get all remaining arguments off of the argument stack and
  3560.  * treat them as a list of name/value pairs for arguments. It returns an ArgList
  3561.  * representing the Xtoolkit version of the arglist passed in, which MUST NOT
  3562.  * BE FREED BY THE CALLER.
  3563.  *
  3564.  * This subroutine will signal an error if
  3565.  * (1) an invalid resource name is used;
  3566.  * (2) the value associated with the resource name is of the wrong type
  3567.  *     (each resource_name expects a unique resource value, if the value
  3568.  *     is a string instead of a value of the expected type, then a resource
  3569.  *     converter is called to convert this value. That may too result in
  3570.  *     an error being signaled if the resource converter couldn't be found...)
  3571.  *
  3572.  * This routine will return with the argument stack empty, or it will signal
  3573.  * an error.
  3574.  ****************************************************************************/
  3575. #define XTARGLIST_SIZE_INCREMENT 20
  3576. static ArgList xt_arglist;    /* init'd in Wres_Init() */
  3577. static Cardinal xt_arglist_size; /* init'd in Wres_Init() */
  3578. ArgList Wres_Get_LispArglist(o_widget, widgetID, prepend_args, prepend_nargs, nargs)
  3579.      LVAL     o_widget;
  3580.      Widget   widgetID;        /* for calling XtConvert if type conv needed */
  3581.      ArgList  prepend_args;    /* arguments to be prepended to result */
  3582.      Cardinal prepend_nargs;    /* number of arguments to be prepended */
  3583.      Cardinal *nargs;        /* returns number of args in result */
  3584. {
  3585.   ArgList             xt_arg;
  3586.   Cardinal            lisp_nargs;
  3587.   LVAL                lval_resname, lval_resval;
  3588.   Resource_Instance  *resource;
  3589.  
  3590.   /*
  3591.    * Various XmRString-->XmR* resource-type converters below will use value of
  3592.    * widgetID to access widget-internal structures such as core.screen core.depth
  3593.    * core.background_pixel core.colormap  manager.foreground primitive.foreground
  3594.    * manager.highlight_color primitive.highlight_color
  3595.    * manager.top_shadow_color primitive.top_shadow_color 
  3596.    * 
  3597.    * Therefore, if widget is a gadget, then set widgetID to gadget's manager to
  3598.    * avoid problems with XtConvert() accessing nonexistant fields
  3599.    * in gadget rec. 
  3600.    */
  3601.   if (XmIsGadget(widgetID))
  3602.     widgetID = ((Object) widgetID)->object.parent;
  3603.     
  3604.   if ((xlargc & 1) != 0)    /* if there's an odd number of args on the stack */
  3605.     xlerror("Widget argument list must consist of pairs of resource-name & value.\n    An odd number of arguments were found, the first being:",
  3606.         *xlargv);
  3607.  
  3608.   lisp_nargs = xlargc / 2;    /* the number of name/value pairs */
  3609.   *nargs = lisp_nargs + prepend_nargs;
  3610.  
  3611.   if (*nargs > xt_arglist_size) { /* make sure xt_arglist is big enough */
  3612.     xt_arglist = (ArgList) XtRealloc(xt_arglist, (unsigned) (*nargs * sizeof(Arg)));
  3613.     xt_arglist_size = *nargs;
  3614.   }
  3615.   xt_arg = xt_arglist;
  3616.  
  3617.   /* copy prepend_args into result ArgList */
  3618.   while (prepend_nargs--)
  3619.     *xt_arg++ = *prepend_args++;
  3620.  
  3621.   /*
  3622.    * now append lisp_arglist into result ArgList:
  3623.    * starting at xt_arg,
  3624.    * while more name/value pairs to process
  3625.    *         get resource name, set xt_arg->name
  3626.    *        get lisp resource value
  3627.    *        convert lisp value to C value
  3628.    *        set xt_arg->value
  3629.    *        go to next xt_arg.
  3630.    */
  3631.   for (    /* xt_arg */ ; lisp_nargs-- ; xt_arg++) {    
  3632.     /* 
  3633.      * get resource name
  3634.      */
  3635.     lval_resname = nextarg();
  3636.     if (xtresource_p(lval_resname))
  3637.       resource = get_xtresource(lval_resname);
  3638.     else if (symbolp(lval_resname)) { /* hasn't been eVALuated yet... */
  3639.       lval_resname = getvalue(lval_resname); /* get the value */
  3640.       if (xtresource_p(lval_resname))
  3641.     resource = get_xtresource(lval_resname);
  3642.       else
  3643.     xlerror("In Widget Arglist: Invalid resource keyword in widget resource list.", lval_resname);
  3644.     }
  3645.     else
  3646.       xlerror("In Widget Arglist: Invalid resource name in widget resource list.", lval_resname);
  3647.  
  3648.     xt_arg->name = resource->name;
  3649.  
  3650.     /* 
  3651.      * get resource value.
  3652.      */
  3653.     lval_resval = nextarg();
  3654.  
  3655.     /* 
  3656.      * check to see if the lval_resval is of the type corresponding to resource.
  3657.      * And if it is, then call appropriate LVAL-->XtArgVal procedure to convert
  3658.      * from a lisp argument to the C equivalent.
  3659.      */
  3660.     if ((lval_resval && (ntype(lval_resval) == resource->class->LVAL_type))
  3661.     || (resource->class->LVAL_type == FREE)) /* FREE stands for any LVAL type (eg, for XmRBoolean, XmRXmStringTable) */
  3662.       xt_arg->value = (*(resource->class->LVAL_to_resource_val_converter))(lval_resval, resource, o_widget);
  3663.  
  3664.     /*
  3665.      * Otherwise, if lisp value is a string, try to do a string to resource->class conversion.
  3666.      */
  3667.     else if (stringp(lval_resval)) {
  3668.  
  3669.       /* 
  3670.        * If the lisp value is a string, and we expect an XmString, override the
  3671.        * default XmRString-->XmRXmString conversion that would be done below
  3672.        * (via XtConvert()) since the Motif 1.0 built-in resource converter
  3673.        * _XmCvtStringToXmString() uses XmStringCreate(). We want to use
  3674.        * XmStringCreateLtoR() which will allow us to create XmStrings with
  3675.        * multiple lines by embedding '\n' characters inside our strings.
  3676.        * Also, by preventing XtConvert() below from doing the String-->XmString
  3677.        * conversion, we can free any converted XmStrings without having to worry
  3678.        * about Xt's kludgy resource cacheing getting in our way.
  3679.        */
  3680.       if (resource->class == &resclass_XmRXmString) {
  3681.     xt_arg->value = (XtArgVal) XmStringCreateLtoR((char*) getstring(lval_resval), XmSTRING_DEFAULT_CHARSET);
  3682.     Wres_Free_This_Later((XtPointer) xt_arg->value, XmStringFree); /* XmStrings are copied into widget upon create/setvalues, so this XmString may be freed later */
  3683.       }
  3684.  
  3685.       /*
  3686.        * Convert a string-->Pixmap, using foreground color as foreground of Pixmap.
  3687.        * This handles resources declared as XmRPrimForegroundPixmap,
  3688.        * XmRGadgetPixmap, XmRManForegroundPixmap. Note that if the widgetID
  3689.        * passed into Wres_Get_LispArglist() is a gadget, code above will
  3690.        * set widgetID to the gadget's manager, thus handling gadgets and
  3691.        * XmRString-->XmRGadgetPixmap conversions correctly.
  3692.        */
  3693.       else if (resource->class == &resclass_ForegroundPixmap) {
  3694.     extern Screen* screen;    /* winterp.c */
  3695.     extern Pixel default_foreground_pixel, default_background_pixel; /* winterp.c */
  3696.  
  3697.     if (XmIsManager(widgetID))
  3698.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmManagerWidget) widgetID)->core.screen,
  3699.                              ((XmManagerWidget) widgetID)->manager.foreground,
  3700.                              ((XmManagerWidget) widgetID)->core.background_pixel,                     
  3701.                              lval_resval, resource, o_widget);
  3702.     else if (XmIsPrimitive(widgetID))
  3703.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmPrimitiveWidget) widgetID)->core.screen,
  3704.                              ((XmPrimitiveWidget) widgetID)->primitive.foreground,
  3705.                              ((XmPrimitiveWidget) widgetID)->core.background_pixel,
  3706.                              lval_resval, resource, o_widget);
  3707.     else if (XtIsShell(widgetID))
  3708.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((ShellWidget) widgetID)->core.screen,
  3709.                              default_foreground_pixel,
  3710.                              ((ShellWidget) widgetID)->core.background_pixel,                     
  3711.                              lval_resval, resource, o_widget);
  3712.     else
  3713.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(screen,
  3714.                              default_foreground_pixel,
  3715.                              default_background_pixel,
  3716.                              lval_resval, resource, o_widget);
  3717.       }
  3718.  
  3719.       /*
  3720.        * Convert a string-->Pixmap, using highlight color as foreground of Pixmap.
  3721.        * This handles resources declared as XmRPrimHighlightPixmap XmRManHighlightPixmap
  3722.        */
  3723.       else if (resource->class == &resclass_HighlightPixmap) {
  3724.     extern Screen* screen;    /* winterp.c */
  3725.     extern Pixel default_foreground_pixel, default_background_pixel; /* winterp.c */
  3726.  
  3727.     if (XmIsManager(widgetID))
  3728.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmManagerWidget) widgetID)->core.screen,
  3729.                              ((XmManagerWidget) widgetID)->manager.highlight_color,
  3730.                              ((XmManagerWidget) widgetID)->core.background_pixel,
  3731.                              lval_resval, resource, o_widget);
  3732.     else if (XmIsPrimitive(widgetID))
  3733.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmPrimitiveWidget) widgetID)->core.screen,
  3734.                              ((XmPrimitiveWidget) widgetID)->primitive.highlight_color,
  3735.                              ((XmPrimitiveWidget) widgetID)->core.background_pixel,
  3736.                              lval_resval, resource, o_widget);
  3737.     else if (XtIsShell(widgetID))
  3738.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((ShellWidget) widgetID)->core.screen,
  3739.                              default_foreground_pixel,
  3740.                              ((ShellWidget) widgetID)->core.background_pixel,                     
  3741.                              lval_resval, resource, o_widget);
  3742.     else
  3743.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(screen,
  3744.                              default_foreground_pixel,
  3745.                              default_background_pixel,
  3746.                              lval_resval, resource, o_widget);
  3747.       }
  3748.  
  3749.       /*
  3750.        * Convert a string-->Pixmap, using topshadow color as foreground of Pixmap.
  3751.        * This handles resources declared as XmRPrimTopShadowPixmap XmRManTopShadowPixmap.
  3752.        */
  3753.       else if (resource->class == &resclass_TopShadowPixmap) {
  3754.     extern Screen* screen;    /* winterp.c */
  3755.     extern Pixel default_foreground_pixel, default_background_pixel; /* winterp.c */
  3756.  
  3757.     if (XmIsManager(widgetID))
  3758.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmManagerWidget) widgetID)->core.screen,
  3759.                              ((XmManagerWidget) widgetID)->manager.top_shadow_color,
  3760.                              ((XmManagerWidget) widgetID)->core.background_pixel,
  3761.                              lval_resval, resource, o_widget);
  3762.     else if (XmIsPrimitive(widgetID))
  3763.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmPrimitiveWidget) widgetID)->core.screen,
  3764.                              ((XmPrimitiveWidget) widgetID)->primitive.top_shadow_color,
  3765.                              ((XmPrimitiveWidget) widgetID)->core.background_pixel,
  3766.                              lval_resval, resource, o_widget);
  3767.     else if (XtIsShell(widgetID))
  3768.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((ShellWidget) widgetID)->core.screen,
  3769.                              default_foreground_pixel,
  3770.                              ((ShellWidget) widgetID)->core.background_pixel,                     
  3771.                              lval_resval, resource, o_widget);
  3772.     else
  3773.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(screen,
  3774.                              default_foreground_pixel,
  3775.                              default_background_pixel,
  3776.                              lval_resval, resource, o_widget);
  3777.       }
  3778.  
  3779.       /*
  3780.        * Convert a string-->Pixmap, using bottomshadow color as foreground of Pixmap.
  3781.        * This handles resources declared as XmRPrimBottomShadowPixmap XmRManBottomShadowPixmap.
  3782.        */
  3783.       else if (resource->class == &resclass_BottomShadowPixmap) {
  3784.     extern Screen* screen;    /* winterp.c */
  3785.     extern Pixel default_foreground_pixel, default_background_pixel; /* winterp.c */
  3786.  
  3787.     if (XmIsManager(widgetID))
  3788.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmManagerWidget) widgetID)->core.screen,
  3789.                              ((XmManagerWidget) widgetID)->manager.bottom_shadow_color,
  3790.                              ((XmManagerWidget) widgetID)->core.background_pixel,
  3791.                              lval_resval, resource, o_widget);
  3792.     else if (XmIsPrimitive(widgetID))
  3793.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((XmPrimitiveWidget) widgetID)->core.screen,
  3794.                              ((XmPrimitiveWidget) widgetID)->primitive.bottom_shadow_color,
  3795.                              ((XmPrimitiveWidget) widgetID)->core.background_pixel,
  3796.                              lval_resval, resource, o_widget);
  3797.     else if (XtIsShell(widgetID))
  3798.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(((ShellWidget) widgetID)->core.screen,
  3799.                              default_foreground_pixel,
  3800.                              ((ShellWidget) widgetID)->core.background_pixel,                     
  3801.                              lval_resval, resource, o_widget);
  3802.     else
  3803.       xt_arg->value = (XtArgVal) Wres_Get_Pixmap(screen,
  3804.                              default_foreground_pixel,
  3805.                              default_background_pixel,
  3806.                              lval_resval, resource, o_widget);
  3807.       }
  3808.  
  3809.       /*
  3810.        * For XmRXmBackgroundPixmap, we must call Motif resource converter since it has a special
  3811.        * side effect. (Which is a very ugly hack on the part of the Motif implementation).
  3812.        * If Visual.c:_XmCvtStringToBackgroundPixmap() changes, then we may need to add conversion
  3813.        * routines similar to above.
  3814.        */
  3815. #ifdef THE_FOLLOWING_CODE_IS_COMMENTED_OUT
  3816. #ifdef WINTERP_MOTIF_11
  3817.       else if (resource->class == &resclass_XmRXmBackgroundPixmap) {
  3818.       }
  3819. #else                /* MOTIF 1.0 */
  3820.       else if (resource->class == &resclass_XmRPixmap) { /* Motif 1.0 also uses a weird side-effecting converter for XmRPixmap */
  3821.       }
  3822. #endif                /* WINTERP_MOTIF_11 */
  3823. #endif                /* THE_FOLLOWING_CODE_IS_COMMENTED_OUT */
  3824.  
  3825.       /* 
  3826.        * if none of the conversions above matched, we call XtConvert() to convert
  3827.        * the resource from a string representaion to the representation type 
  3828.        * specified in resource->class->XmR_type.
  3829.        */
  3830.       else {
  3831.     XrmValue from, to;
  3832.     from.size = (unsigned int) getslength(lval_resval);
  3833.     from.addr = (XtPointer) getstring(lval_resval);
  3834.     XtConvert(widgetID, XmRString, &from, resource->class->XmR_type, &to);
  3835.     if (to.addr == NULL) {    /* error if conversion failed */
  3836.       sprintf(temptext, "In Widget Arglist, error in converting XmRstring-->XmR%s.", resource->class->XmR_type);
  3837.       xlerror(temptext, lval_resval);    
  3838.     }
  3839.     xt_arg->value = *((XtArgVal *) to.addr);
  3840.       }
  3841.     }                /* end: "else if (stringp(lval_resval))" */
  3842.     else {
  3843.       sprintf(temptext, "In Widget Arglist: expected resource value of type XmR%s.", resource->class->XmR_type);
  3844.       xlerror(temptext, lval_resval);
  3845.     }
  3846.   }                /* end: "for ( ; lisp_nargs-- ; xt_arg++)" */
  3847.   return (xt_arglist);
  3848. }
  3849.  
  3850.  
  3851. /******************************************************************************
  3852.  * Wres_Get_GetValues_ArgList() // Wres_GetValues_ArgList_To_Lisp()
  3853.  * 
  3854.  * Wres_Get_GetValues_ArgList() will get all remaining arguments off of the
  3855.  * argument stack and treat them as a list of name/symbol pairs for arguments
  3856.  * to WIDGET_CLASS method :get_values. It returns an ArgList representing
  3857.  * the Xtoolkit version of the arglist passed in, which MUST NOT BE FREED
  3858.  * BY THE CALLER. XtGetValues() should then be called on the arglist, and
  3859.  * then the symbols from the arglist get set to values retrieved from
  3860.  * XtGetValues() in proc Wres_GetValues_ArgList_To_Lisp()
  3861.  * 
  3862.  *
  3863.  * Wres_Get_GetValues_ArgList() will signal an error if
  3864.  * (1) an invalid resource name is used;
  3865.  * (2) lack of C->Lisp converter, or error in conversion.
  3866.  *
  3867.  * Wres_Get_GetValues_ArgList() will return with the argument stack empty,
  3868.  * or it will signal an error.
  3869.  ******************************************************************************/
  3870.  
  3871. typedef struct _GetValues_Info {
  3872.  
  3873.   /*
  3874.    * this MUST be the first field in this struct. struct _GetValues_Info is
  3875.    * pointed to by (XtArgVal).value and this location gets written to by
  3876.    * XtGetValues(). XtGetValues() ends up writing data up to
  3877.    * sizeof(XtArgVal)==sizeof(XtPointer) at the location pointed to by
  3878.    * (XtArgVal).value. Note that since between 1-4 bytes get written here,
  3879.    * we can't use casting to retrieve the value, rather we must retrieve the
  3880.    * type by accessing a union member when data is passed in to the
  3881.    * function (*resource_val_to_LVAL_converter)().
  3882.    */
  3883.   GetValues_Union data; 
  3884.  
  3885.   /*
  3886.    * a pointer to the resource information, including the function that takes 'data'
  3887.    * slot and returns it's LISP equivalent:
  3888.    * (->resource->class->resource_val_to_LVAL_converter)(GetValues_Union data ; Resource_Instance* resource; )
  3889.    */
  3890.   Resource_Instance* resource;
  3891.  
  3892.   /*
  3893.    * a 'setf' place form for telling Wres_GetValues_ArgList_To_Lisp()
  3894.    * where to put getvalues result
  3895.    */
  3896.   LVAL place_for_result;
  3897.  
  3898. } GetValues_Info;
  3899.  
  3900. #define GETARGLIST_SIZE_INCREMENT 20
  3901. static ArgList getarglist;    /* init'd in Wres_Init() */
  3902. static Cardinal getarglist_size; /* init'd in Wres_Init() */
  3903.  
  3904. ArgList Wres_Get_GetValues_ArgList(numargs)
  3905.      Cardinal *numargs;
  3906. {
  3907.   ArgList             xt_arg;
  3908.   Cardinal            argcount;
  3909.  
  3910.   if ((xlargc & 1) != 0)    /* if there's an odd number of args on the stack */
  3911.     xlerror(":get_values argument list must consist of pairs of resource-name & symbol.\n    An odd number of arguments were found, the first being:",
  3912.         *xlargv);
  3913.   
  3914.   *numargs = argcount = xlargc / 2; /* the number of name/value pairs */
  3915.  
  3916.   if (argcount > getarglist_size) { /* make sure getarglist is big enough */
  3917.     getarglist = (ArgList) XtRealloc(getarglist, (unsigned) (argcount * sizeof(Arg)));
  3918.     while (getarglist_size < argcount)
  3919.       getarglist[getarglist_size++].value = (XtArgVal) XtMalloc(sizeof(GetValues_Info)); /* note bogus jacking in of object larger than XtArgVal for use by Wres_GetValues_ArgList_To_Lisp() */
  3920.     /* xt_arglist_size = argcount; */
  3921.   }
  3922.  
  3923.   for (xt_arg = getarglist;  (argcount--); xt_arg++) { /* while more name/value pairs to process */
  3924.     Resource_Instance  *resource;
  3925.     GetValues_Info     *elt;
  3926.     LVAL                lval_resname;
  3927.  
  3928.     /* 
  3929.      * get <resource-name> keyword and retrieve its Resource_Instance structure
  3930.      */
  3931.     lval_resname = nextarg();
  3932.     if (xtresource_p(lval_resname))
  3933.       resource = get_xtresource(lval_resname);
  3934.     else if (symbolp(lval_resname)) { /* hasn't been eVALuated yet... */
  3935.       lval_resname = getvalue(lval_resname); /* get the value */
  3936.       if (xtresource_p(lval_resname))
  3937.     resource = get_xtresource(lval_resname);
  3938.       else
  3939.     xlerror("Invalid resource keyword in widget :get_values resource list.", lval_resname);
  3940.     }
  3941.     else
  3942.       xlerror("Invalid resource name in widget :get_values resource list.", lval_resname);
  3943.     xt_arg->name = resource->name;
  3944.  
  3945.     elt = (GetValues_Info *) xt_arg->value;
  3946.  
  3947.     /*
  3948.      * get <placeform> argument indicating where retrieved value should go.
  3949.      */
  3950.     elt->place_for_result = xlgetarg();    /* get a place to put val */
  3951.     if (!( null(elt->place_for_result) || symbolp(elt->place_for_result) || consp(elt->place_for_result) ))
  3952.       xlerror(":get_values expected a <place> form, either NIL, a symbol, or a place-form.", elt->place_for_result);
  3953.     
  3954.     /* 
  3955.      * Set the Resource_Instance pointer for the resource class.
  3956.      */
  3957.     elt->resource = resource;
  3958.  
  3959.     /*
  3960.      * Set the 'data' slot to a known-but-implausible XtPointer-sized value so that we can
  3961.      * check (in Wres_GetValues_ArgList_To_Lisp()) whether XtGetValues() writes into the data
  3962.      * slot. We check for this value in Wres_GetValues_ArgList_To_Lisp() and report an error
  3963.      * if the value is still there. CAN YOU SAY HACK?? SURE YOU CAN...
  3964.      */
  3965.     elt->data.XtPointer_value = (XtPointer) LONG_MIN; /* LONG_MIN from <limits.h> -- if this is a 2'sC machine, sets 'data' to 11111111 11111111 11111111 11111111 */
  3966.     
  3967.   }
  3968.   return (getarglist);
  3969. }
  3970.  
  3971.  
  3972. LVAL Wres_GetValues_ArgList_To_Lisp(arglist, numargs)
  3973.      ArgList arglist;
  3974.      Cardinal numargs;
  3975. {
  3976.   GetValues_Info *elt;
  3977.   LVAL result,cur,next,lval = NIL;
  3978.   xlstkcheck(3);
  3979.   xlsave(result);
  3980.   xlsave(next);
  3981.   xlsave(lval);
  3982.     
  3983.   while (numargs--) {
  3984.     elt = (GetValues_Info *) (*arglist++).value;
  3985.  
  3986.     /* 
  3987.      * A quick check to see if the resource name was valid for this widget.
  3988.      * In Wres_Get_GetValues_ArgList(), we set elt->data.XtPointer_value = LONG_MIN;
  3989.      * If the resource was invalid, this value won't get touched. Therefore we
  3990.      * check to see if LONG_MIN is still there, and if so, we report an error.
  3991.      */
  3992.     if (elt->data.XtPointer_value == (XtPointer) LONG_MIN)
  3993.       xlerror("in :GET_VALUES -- invalid resource name for this widget class", elt->resource->symbol);
  3994.     
  3995.     /*
  3996.      * Convert elt->data (set by XtGetValues() call) to a lisp value depending on the
  3997.      * resource type. elt->data is written into by XtGetValues which only writes
  3998.      * the number of bytes required by the type of the resource. Since the type of the
  3999.      * data written is dependent on the resource-type, we cannot just coerce the result
  4000.      * to a XtPointer and pass that onto the (resource_val_to_LVAL_converter)() conversion
  4001.      * routine. Instead, we define elt->data as a union of all the possible types used by
  4002.      * Xt resources, and the (resource_val_to_LVAL_converter)() will then use the
  4003.      * appropriate part of the union depending on the type of data it expects to retrieve.
  4004.      * The converter then returns the appropriate lisp value.
  4005.      */
  4006.     lval = (*(elt->resource->class->resource_val_to_LVAL_converter))(elt->data, elt->resource);
  4007.  
  4008.     /*
  4009.      * set retrieved & converted resource value to <placeform> set in elt->place_for_result.
  4010.      */
  4011.     if (!(elt->place_for_result)) { /* if NIL, then return the value as function's result */
  4012.       next = cons(lval, NIL);
  4013.       if (result) {
  4014.     rplacd(cur, next);
  4015.     cur = next;
  4016.       }
  4017.       else
  4018.     result = cur = next;
  4019.     }
  4020.     else            /* stolen from xsetf() */
  4021.       if (symbolp(elt->place_for_result)) /* if place_for_result is a symbol, set the symbol's value to lval */
  4022.     xlsetvalue(elt->place_for_result, lval);
  4023.       else if (consp(elt->place_for_result)) /* else if it's a placeform, then set lval to datastruct spec'd by placeform */
  4024.     placeform(elt->place_for_result, lval);
  4025.       else
  4026.     xlfail("bad place form");
  4027.   }
  4028.   
  4029.   xlpopn(3);
  4030.   return (result);
  4031. }
  4032.  
  4033.  
  4034. /*****************************************************************************
  4035.  * This accesses the symbol value of a resource instance object (whose type
  4036.  * is opaque outside of this module). It is used in xlprint.c:xlprint().
  4037.  *
  4038.  * It is assumed that the parameter res's type is such that
  4039.  * ntype(res) == XLTYPE_XT_RESOURCE.
  4040.  ****************************************************************************/
  4041. LVAL Wres_Get_Symbol(res)
  4042.      LVAL res;
  4043. {
  4044.   return (get_xtresource(res)->symbol);
  4045. }
  4046.  
  4047. /*****************************************************************************
  4048.  * This accesses the XmN* name of a resource instance object (whose type
  4049.  * is opaque outside of this module). 
  4050.  *
  4051.  * It is assumed that the parameter res's type is such that
  4052.  * ntype(res) == XLTYPE_XT_RESOURCE.
  4053.  ****************************************************************************/
  4054. char* Wres_Get_Name(res)
  4055.      LVAL res;
  4056. {
  4057.   return (get_xtresource(res)->name);
  4058. }
  4059.  
  4060. /******************************************************************************
  4061.  * It is assumed that the parameter res's type is such that
  4062.  * ntype(res) == XLTYPE_XT_RESOURCE.
  4063.  ******************************************************************************/ 
  4064. Boolean Wres_Is_Callback_P(res)
  4065.      LVAL res;
  4066. {
  4067.   return (get_xtresource(res)->class == &resclass_XmRCallback);
  4068. }
  4069.  
  4070.  
  4071. /*****************************************************************************
  4072.  * This initializes the resource symbols in xlisp. It is called in main().
  4073.  ****************************************************************************/
  4074. Wres_Init()
  4075. {
  4076.  
  4077.   /* initialize resource symbols and values */
  4078.   {
  4079.     register Resource_Instance *resource;
  4080.     register LVAL              sym;
  4081.  
  4082.     for (resource = &(resource_table[0]); resource->printname; resource++) {
  4083.       sym = resource->symbol = xlenter(resource->printname);
  4084.       setvalue(sym, cv_xtresource(resource));
  4085.     }
  4086.   }
  4087.  
  4088.   /* set up storage space for Wres_Get_LispArglist() */
  4089.   xt_arglist = (ArgList) XtMalloc((unsigned) (XTARGLIST_SIZE_INCREMENT * sizeof(Arg)));
  4090.   xt_arglist_size = XTARGLIST_SIZE_INCREMENT;
  4091.  
  4092.   /* set up storage space used by Wres_Free_C_Arglist_Data() and Wres_Free_This_Later() */
  4093.   freeables_size = FREEABLES_SIZE_INCREMENT;
  4094.   freeables_end_idx = 0;
  4095.   freeables = (struct Argval_Deallocator_Pair *) XtMalloc((unsigned) (FREEABLES_SIZE_INCREMENT * sizeof(struct Argval_Deallocator_Pair)));
  4096.  
  4097.   /* set up storage space for Wres_Get_GetValues_ArgList() and Wres_GetValues_ArgList_To_Lisp() */
  4098.   getarglist = (ArgList) XtMalloc((unsigned) (GETARGLIST_SIZE_INCREMENT * sizeof(Arg))); 
  4099.   getarglist_size = 0;
  4100.   while (getarglist_size < GETARGLIST_SIZE_INCREMENT)
  4101.     getarglist[getarglist_size++].value = (XtArgVal) XtMalloc(sizeof(GetValues_Info)); /* note bogus jacking in of object larger than XtArgVal for use by Wres_Set_Lisp_Vars_From_GetValues_ArgList() */
  4102.   /* getarglist_size = GETARGLIST_SIZE_INCREMENT */
  4103.  
  4104.   /* initialize keyword symbols defined in 'Resource_Enums' tables */
  4105.   Init_Enumerated_Type_Syms(XmRAlignment_enums_alist);
  4106.   Init_Enumerated_Type_Syms(XmRArrowDirection_enums_alist);
  4107.   Init_Enumerated_Type_Syms(XmRAttachment_enums_alist);
  4108.   Init_Enumerated_Type_Syms(XmRDefaultButtonType_enums_alist);
  4109.   Init_Enumerated_Type_Syms(XmRDeleteResponse_enums_alist);
  4110.   Init_Enumerated_Type_Syms(XmRDialogStyle_enums_alist);
  4111.   Init_Enumerated_Type_Syms(XmRDialogType_enums_alist);
  4112.   Init_Enumerated_Type_Syms(XmREditMode_enums_alist);
  4113.   Init_Enumerated_Type_Syms(XmRIndicatorType_enums_alist);
  4114.   Init_Enumerated_Type_Syms(XmRKeyboardFocusPolicy_enums_alist);
  4115.   Init_Enumerated_Type_Syms(XmRLabelType_enums_alist);
  4116.   Init_Enumerated_Type_Syms(XmRListSizePolicy_enums_alist);
  4117.   Init_Enumerated_Type_Syms(XmROrientation_enums_alist);
  4118.   Init_Enumerated_Type_Syms(XmRPacking_enums_alist);
  4119.   Init_Enumerated_Type_Syms(XmRProcessingDirection_enums_alist);
  4120.   Init_Enumerated_Type_Syms(XmRResizePolicy_enums_alist);
  4121.   Init_Enumerated_Type_Syms(XmRRowColumnType_enums_alist);
  4122.   Init_Enumerated_Type_Syms(XmRScrollBarDisplayPolicy_enums_alist);
  4123.   Init_Enumerated_Type_Syms(XmRScrollBarPlacement_enums_alist);
  4124.   Init_Enumerated_Type_Syms(XmRScrollingPolicy_enums_alist);
  4125.   Init_Enumerated_Type_Syms(XmTextScanType_enums_alist);
  4126.   Init_Enumerated_Type_Syms(XmRSelectionPolicy_enums_alist);
  4127.   Init_Enumerated_Type_Syms(XmRSeparatorType_enums_alist);
  4128.   Init_Enumerated_Type_Syms(XmRShadowType_enums_alist);
  4129.   Init_Enumerated_Type_Syms(XmRStringDirection_enums_alist);
  4130.   Init_Enumerated_Type_Syms(XmRWhichButton_enums_alist);
  4131.   Init_Enumerated_Type_Syms(XmRUnitType_enums_alist);
  4132.   Init_Enumerated_Type_Syms(XmRVisualPolicy_enums_alist);
  4133. #ifdef WINTERP_MOTIF_11
  4134.   Init_Enumerated_Type_Syms(XmRButtonType_enums_alist);
  4135.   Init_Enumerated_Type_Syms(XmRWindowGravity_enums_alist);
  4136.   Init_Enumerated_Type_Syms(XmRCommandWindowLocation_enums_alist);
  4137.   Init_Enumerated_Type_Syms(XmRFileTypeMask_enums_alist);
  4138.   Init_Enumerated_Type_Syms(XtRInitialState_enums_alist);
  4139.   Init_Enumerated_Type_Syms(XmRMultiClick_enums_alist);
  4140.   Init_Enumerated_Type_Syms(XmRNavigationType_enums_alist);
  4141. #endif
  4142. #ifdef HP_GRAPH_WIDGET
  4143.   Init_Enumerated_Type_Syms(XmRArcDirection_enums_alist);
  4144.   Init_Enumerated_Type_Syms(XmRLineStyle_enums_alist);
  4145.   Init_Enumerated_Type_Syms(XmRCapStyle_enums_alist);
  4146.   Init_Enumerated_Type_Syms(XmRArcDrawMode_enums_alist);
  4147. #endif
  4148.  
  4149.   /* initialize keyword symbols used by :get_child methods on various widget classes */
  4150.   s_XmDIALOG_WORK_AREA        = xlenter(":DIALOG_WORK_AREA");
  4151.   s_XmDIALOG_APPLY_BUTTON    = xlenter(":DIALOG_APPLY_BUTTON");
  4152.   s_XmDIALOG_CANCEL_BUTTON    = xlenter(":DIALOG_CANCEL_BUTTON");
  4153.   s_XmDIALOG_DEFAULT_BUTTON    = xlenter(":DIALOG_DEFAULT_BUTTON");
  4154.   s_XmDIALOG_OK_BUTTON        = xlenter(":DIALOG_OK_BUTTON");
  4155. #ifdef WINTERP_MOTIF_11
  4156.   s_XmDIALOG_DIR_LIST        = xlenter(":DIALOG_DIR_LIST");
  4157.   s_XmDIALOG_DIR_LIST_LABEL    = xlenter(":DIALOG_DIR_LIST_LABEL");
  4158. #endif                /* WINTERP_MOTIF_11 */
  4159.   s_XmDIALOG_FILTER_LABEL    = xlenter(":DIALOG_FILTER_LABEL");
  4160.   s_XmDIALOG_FILTER_TEXT    = xlenter(":DIALOG_FILTER_TEXT");
  4161.   s_XmDIALOG_HELP_BUTTON    = xlenter(":DIALOG_HELP_BUTTON");
  4162.   s_XmDIALOG_LIST        = xlenter(":DIALOG_LIST");
  4163.   s_XmDIALOG_HISTORY_LIST    = xlenter(":DIALOG_HISTORY_LIST");
  4164.   s_XmDIALOG_LIST_LABEL        = xlenter(":DIALOG_LIST_LABEL");
  4165.   s_XmDIALOG_MESSAGE_LABEL    = xlenter(":DIALOG_MESSAGE_LABEL");
  4166.   s_XmDIALOG_SELECTION_LABEL    = xlenter(":DIALOG_SELECTION_LABEL");
  4167.   s_XmDIALOG_PROMPT_LABEL    = xlenter(":DIALOG_PROMPT_LABEL");
  4168.   s_XmDIALOG_SYMBOL_LABEL    = xlenter(":DIALOG_SYMBOL_LABEL");
  4169.   s_XmDIALOG_TEXT        = xlenter(":DIALOG_TEXT");
  4170.   s_XmDIALOG_COMMAND_TEXT    = xlenter(":DIALOG_COMMAND_TEXT");
  4171.   s_XmDIALOG_SEPARATOR        = xlenter(":DIALOG_SEPARATOR");
  4172.  
  4173.   {
  4174.     LVAL sym;
  4175.  
  4176.     /* logior-able values for resource :XMN_MWM_FUNCTIONS */
  4177.     sym = xlenter("MWM_FUNC_ALL");
  4178.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_ALL));
  4179.     sym = xlenter("MWM_FUNC_RESIZE");
  4180.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_RESIZE));
  4181.     sym = xlenter("MWM_FUNC_MOVE");
  4182.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_MOVE));
  4183.     sym = xlenter("MWM_FUNC_MINIMIZE");
  4184.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_MINIMIZE));
  4185.     sym = xlenter("MWM_FUNC_MAXIMIZE");
  4186.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_MAXIMIZE));
  4187.     sym = xlenter("MWM_FUNC_CLOSE");
  4188.     setvalue(sym, cvfixnum((FIXTYPE) MWM_FUNC_CLOSE));
  4189.  
  4190.     /* logior-able values for resource :XMN_MWM_DECORATIONS */
  4191.     sym = xlenter("MWM_DECOR_ALL");
  4192.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_ALL));
  4193.     sym = xlenter("MWM_DECOR_BORDER");
  4194.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_BORDER));
  4195.     sym = xlenter("MWM_DECOR_RESIZEH");
  4196.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_RESIZEH));
  4197.     sym = xlenter("MWM_DECOR_TITLE");
  4198.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_TITLE));
  4199.     sym = xlenter("MWM_DECOR_MENU");
  4200.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_MENU));
  4201.     sym = xlenter("MWM_DECOR_MINIMIZE");
  4202.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_MINIMIZE));
  4203.     sym = xlenter("MWM_DECOR_MAXIMIZE");
  4204.     setvalue(sym, cvfixnum((FIXTYPE) MWM_DECOR_MAXIMIZE));
  4205.  
  4206.     /* logior-able values for resource :XMN_MWM_INPUT_MODE */
  4207.     sym = xlenter("MWM_INPUT_MODELESS");
  4208.     setvalue(sym, cvfixnum((FIXTYPE) MWM_INPUT_MODELESS));
  4209. #ifdef WINTERP_MOTIF_11
  4210.     sym = xlenter("MWM_INPUT_PRIMARY_APPLICATION_MODAL");
  4211.     setvalue(sym, cvfixnum((FIXTYPE) MWM_INPUT_PRIMARY_APPLICATION_MODAL));
  4212. #else /* MOTIF 1.0 */
  4213.     sym = xlenter("MWM_INPUT_APPLICATION_MODAL");
  4214.     setvalue(sym, cvfixnum((FIXTYPE) MWM_INPUT_APPLICATION_MODAL));
  4215. #endif /* WINTERP_MOTIF_11 */
  4216.     sym = xlenter("MWM_INPUT_SYSTEM_MODAL");
  4217.     setvalue(sym, cvfixnum((FIXTYPE) MWM_INPUT_SYSTEM_MODAL));
  4218. #ifdef WINTERP_MOTIF_11
  4219.     sym = xlenter("MWM_INPUT_FULL_APPLICATION_MODAL");
  4220.     setvalue(sym, cvfixnum((FIXTYPE) MWM_INPUT_FULL_APPLICATION_MODAL));
  4221. #endif /* WINTERP_MOTIF_11 */
  4222.   }
  4223. }
  4224.